Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do a select statement
Message
De
14/09/2000 12:58:37
J Chris Powell
Myers and Stauffer Lc
Kansas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00416327
Message ID:
00416482
Vues:
36
Another way you can accomplish this is to add code similar to this in the interactive change of your listbox:

Thisform.ListOfStuff = ""
FOR nCnt = 1 TO THIS.ListCount
IF THIS.Selected(nCnt)
THISFORM.ListOfStuff = Thisform.ListOfStuff + IIF(EMPTY(Thisform.ListOfStuff),"'","','") + THIS.List(nCnt)
ENDIF
ENDFOR

Thisform.ListOfStuff = Thisform.ListOfStuff + "'"


Notice the single quotes surrounded by double quotes. This will store a comma delimited list suitable for macro substitution in your select statement, depending on how many items can possibly be selected. You can then store this property to a variable a place it in an INLIST in your select statement:

ListOfStuff = Thisform.ListOfStuff
SELECT * FROM Somewhere WHERE INLIST(MyField, &ListOfStuff.)

Hope this helps
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform