Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I select records based on a list
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How do I select records based on a list
Divers
Thread ID:
00919766
Message ID:
00919766
Vues:
73
I have a listbox where a user selects multiple items. I am building a list with selected items and then I want to use that list to extract values from a table. The list can vary depending on how many thing the user selects from list box. How can I write a query based on items from the list.

for example I have a list built using commas
*lcList contains items selected from listbox
*lcList contains values like 'CAMP,JUV,ADULT' etc.
how do I write a query that selects units that contain values from lcList?

for example:
select * from vehicle where v_unit = the lcList
I can write

select * from vehicle where v_unit = 'CAMP' or v_unit = 'JUV' or v_unit = 'ADULT'


but my list can vary depending on items selected from list box and I don't how to write a query where v_unit can be dynamically used.

thanks
Nick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform