Subject Re: [firebird-support] Re: Custom search string
Author Grant Brown
Hi Ali,

>ABC.SQL.Add('where Detect= :123);
>if X = true then ABC.SQL.Add('and Text1= :T1);
>if C = true then ABC.SQL.Add('and Text2= :T2);

>> try this:

>> where detect = :par1
and
(:X=false or text1= :T1)
and
(:Y=false or text2= :T2)
and
(:Z=false or text3= :T3)
and
(:X2=false or text4= :T12)
and
(:Y2=false or text5= :T22)

If I do it this way I then need to set up an if statement to cover all
possibilitys for all 10 input variables. That would be a fairly large if
statement.

>if X = true then ABC.SQL.Add('and Text1= :T1);

In this case the X is not a variable to search on its just a flag to say
"please add T1 to the search string"

If X = false then T1 does not become even part of the SQL search string.

--
Regards,
Grant Brown

Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au

SiteDoc - Easy to Use - Powerful Results