Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How i will retrive data based variable condition
Message
 
 
À
04/06/2005 07:44:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01020224
Message ID:
01020256
Vues:
17
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform