Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wild card in where clause
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00246921
Message ID:
00247286
Views:
15
>>>Also what would work for a logical field? I have a form property with a nValue of 0, 1 or 2 and I want to select on obsolete = .t., .f. or either.
>>>
>
>Assuming that 0 = .T., 1 = .F. and 2 were either, you could write a nested IIF() statement like:
>
>IIF(nValue = 2, .t., IIF(nValue = 1, ! obsolete, obsolute))
>
>but it's ugly and not portable. You might consider building the SQL SELECT statement in a string and executing it via macro expansion instead, which could embed the correct condition(s) in the WHERE clause based on your form values.

I played around with it today and went with you suggestion of building the SELECT as string. Works great. Thanks
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Reply
Map
View

Click here to load this message in the networking platform