Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Do Dynamic Query Construction in SQL Server SP
Message
 
 
To
14/10/2009 17:32:08
Bill Drew
Independent Consultant
Chicago, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01428769
Message ID:
01429437
Views:
36
>>If you have NULLs in any of your fields this query will return different result than
>>
>>                        SELECT * FROM case4 WHERE
>>                              (@LastSearch IS NULL OR patientlast LIKE @LastSearch+'%') AND
>>etc.
>So far my testing has given me what I'm looking for. Not planning on using OR logic. Is it the OR logic that you see as the problem?

Using OR logic is better because your current version will not return records with NULLs in them - unless it is intentional.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform