Select to view content in your preferred language

Query.where problem

621
2
07-22-2010 01:43 PM
MichaelSmilie
New Contributor
I have a situation where I make a query dynamicly and the where clause can be quite long. This can work fine when testing on the server but when testing on client computers it throws a Fault for the where clauses that are generated that have above 10 OR statements. So if the user searches for an item that has

Bldg_Name = 'blah' OR Bldg_Name = 'bleh' OR Bldg_Name = 'blegh'...x10

A Fault will be thrown on their computer but this issue will not happen on the server. Any help would be greatly appreciated.

Thanks,
Smilie
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Smilie,

  If you are querying the same field i.e Bldg_Name than the better SQL Query would be

Bldg_Name IN (123,234,345,456,763,566,777,888,999)
0 Kudos
MichaelSmilie
New Contributor
Thanks Robert, this worked perfectly.
0 Kudos