Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How i will retrive data based variable condition
Message
 
 
To
04/06/2005 07:44:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01020224
Message ID:
01020256
Views:
19
cCod = '1'
cBranch = 'Brn1'
IF Thisform.Check1.Value = 1
   cCondition = 'ItmMast.ItemCod = ?cCod'
Else
   cCondition = 'ItmMast.ItemBrn = ?cBranch'
Endif
cSql = "Select ItmCod, ItmDes From ItmMast Where " + cCondition
SQLExec(nConn, cSQL )
>
>I have an sql Query statement, i want retrive data based on condition like
>cCod = '1'
>cBranch = 'Brn1'
>
>IF Thisform.Check1.Value = 1
>   cCondition = 'ItmMast.ItemCod = cCod'
>Else
>   cCondition = 'ItmMast.ItemBrn = cBranch'
>Endif
>
>'Select ItmCod, ItmDes From ItmMast Where cCondition'
>How i will i convert this to an Sql Server statement.
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform