Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using option button in sql
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
MS SQL Server
Miscellaneous
Thread ID:
01311140
Message ID:
01311187
Views:
26
>I am using with set filter command like this.
>
> If thisform.optionbuttion.value=1
>set filter to sex=1
>endif
> If thisform.optionbuttion.value=2
>set filter to sex=2
>endif
> If thisform.optionbuttion.value=3
>set filter to sex=3
>endif
>but now i want to use in sql

You could use the same approach:
DO CASE
   CASE thisform.optionbuttion.value=1
        SELECT ..... WHERE Sex = 1
   CASE thisform.optionbuttion.value=2
        SELECT ..... WHERE Sex = 2
OTHERWISE
        SELECT .....
ENDCASE
That is compilation of Naomi and Sergey's suggestions :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform