Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql dynamic
Message
From
17/10/2011 15:16:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Sql dynamic
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01526661
Message ID:
01526661
Views:
96
hi all, I need help with this, I want to do a consultation with several parameters in a stored procedure but these parameters do not always have values, but which depends on parameters chosen by the user in vfp I do by creating a variable with the possible selection conditions as follows
cond= cond + "and x condition" and end of the WHERE I put the & cond. but not how to do something the same or similar in sql editor in stored procedure

for example
cond=''
if !empty(thisform.txtfecha1.value)
       mfecha=dtos(thisform.txtfecha.value)
	condi=condi+[ and fecha>=']+mfecha1+[']
        sql=[select * from tabla where x>0 &cond]
endif
Jose Manuel Ramirez
Next
Reply
Map
View

Click here to load this message in the networking platform