Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select query with where condition using IF
Message
From
21/05/2004 14:44:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Select query with where condition using IF
Miscellaneous
Thread ID:
00906100
Message ID:
00906100
Views:
42
i want to run a select query, i have two text boxes text1 and text2,

If any of the text fields are filled then the values need to be passed to the select query text1 for project, text2 for contract.

Can you please modify the following to do the above function, the following i use mostly in VB. I am not good in foxpro.

***************
if thisform.text1.value <> "" then
swhere = "where project = thisform.text1.value ";
endif

if thisform.text2.value <> "" then
if swhere <> "" then
swhere = swhere & "contract=thisform.text2.value ";
else
swhere = "contract=thisform.text2.value ";
endif
endif

sorder = "order by projid"

swherestatement = swhere + sorder

lSQL = [select * from customers swherestatement into cursor lcSource]

*********************

Thank you very much in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform