Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
SQL : Select multiple filter condition using variable ?
All,
I have a SQL SELECT statement for retrieving my data, and one of the major item is the filter condition, as follow:
SELECT ................ WHERE mycursor.month IN ("02/99","04/99")
However, I need to allow the user the enter the filter condition that he wants in a textbox with the controlsource of the textbox is set to a memory variable (eg, mMonth).
Example,
The user will type :
"02/99","04/99","06"/99"
to filter the month of Feb99,Apr99 and Jun99 which are separated by commas.
Therefore, I put the statement as WHERE mycursor.month IN (mMonth), but the command treated mMonth as a string.
How should I deal with things like this? Suggestion?
Thanks,
Gan
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement