Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL question
Message
From
18/02/2000 13:44:34
Walter Meester
HoogkarspelNetherlands
 
 
To
18/02/2000 13:20:35
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00334207
Message ID:
00334238
Views:
23
Jerry,

Seems you want to have a static SQL statment that produces different results caused by the parameters.

One method is to construct the WHERE clause dynamicly.

cWhere= somewhere expression
SELECT * FROM mytable WHERE &cWhere

In local views you can use SELECT * FROM mytable WHERE &?cWhere, but be sure the cWhere variable is available whenever using REQUERY.

Regards,

Walter,




>I have a table with these fields; cdesc, nprice.
>
>I can SELECT * FROM mytable WHERE cdesc = "". This will produce a cursor with all records in the results, which is what I want.
>
>How can I do the same for the numeric field?
>
>SELECT * FROM mytable WHERE cdesc = "" AND nprice = 0 only brings up the records with 0 in nprice. I want all the records. Then I want the user to narrow the search like this;
>SELECT * FROM mytable WHERE cdesc = cvar AND nprice = nvar
>
>How can I do this?
>
>Thanks,
Previous
Reply
Map
View

Click here to load this message in the networking platform