General information
Title:
Select query with where condition using IF
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only