Seach for specific text in String field
Hey there,
I was just trying to find a specific text in a string field the database provides.
For example, I have a field that contains this text: "fnwefuhaCXRsafhi1235". Now I want to build a procedure that searches this field for a specific string, say "CXR". This text can be positioned at any point in the string field.
In SQL I'd just use LIKE and the specific string with wildcards. Is there something like that in Report Builder?
Couldn't find anything on the matter via search.
Thanks in advance.
I was just trying to find a specific text in a string field the database provides.
For example, I have a field that contains this text: "fnwefuhaCXRsafhi1235". Now I want to build a procedure that searches this field for a specific string, say "CXR". This text can be positioned at any point in the string field.
In SQL I'd just use LIKE and the specific string with wildcards. Is there something like that in Report Builder?
Couldn't find anything on the matter via search.
Thanks in advance.
Comments
When using the DADE Query Designer, it is possible to define the "Like" search operator using the search tab. This can then be linked to a report parameter value and used with the AutoSearch feature if needed.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thanks for your reply. This isn't really what I need - probably because my question was too vague.
I can't use the search function as this limits the data the report can use. Otherwise the "Like" option in your screenshould would be my choice as well.
So let my rephrase what I need to do.
My database contains a String field and I must check it for multiple Strings it can hold:
* If the string "AAA" is somewhere in it, the element DBText1 needs to be visible and DBText2 invisible.
* If the string "BBB" is somewhere in it, the element DBText2 needs to be visible and DBText1 invisible.
* If none of the above applies, both DBText1 and 2 need to be invisible but DBText3 must be visible and contain a custom text.
That's why I can't use the search function of the query (probably). I can't seem to find a way to search for strings within a field when building a calculation in the Calc tab.
var
iPos: Integer;
strSearch: String;
begin
Text := DBRichText2.PlainText;
repeat
strSearch := 'AAA';
iPos := Pos(strSearch, Text);
if (iPos > 0) then
begin
DBText1.Visible := true;
DBText2.Visible := false;
end;
until iPos = 0;
repeat
strSearch := 'BBB';
iPos := Pos(strSearch, Text);
if (iPos > 0) then
begin
DBText1.Visible := false;
DBText2.Visible := true;
end;
until iPos = 0;
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com