hi all
I'm trying to create a parameter query where the user supplies a list of years, and the query uses the IN operator with the supplied criteria. eg if the user wants data from last year, 2007 and 2001, they type the following in the parameter dialog:
(2001, 2007, 2009)
Access tells me that the expression is typed incorrectly or is too complex to be evaluated and then suggests I simplify the expression by assigning parts of the expression to variables. I have tried with brackets around the whole parameter as above, no brackets, brackets around each item - and just to make sure all straws were clutched - quotes around each item.
The query design grid has: In ([Years_Parm]) in the Criteria bit.
I can get it to work with 'Like [Years_Parm]' when I input 200*.
I can get it to work with 'Between [Year_Parm1] And [Year_Parm2]' when I input a start and end year.
I just can't get it to work with 'In ([Years_Parm])'
I want the In operator so I don't have to deal with data from years I don't need (ie 2002-2006 & 2008 in the above)
Any suggestions?
tia,
mcalex
I'm trying to create a parameter query where the user supplies a list of years, and the query uses the IN operator with the supplied criteria. eg if the user wants data from last year, 2007 and 2001, they type the following in the parameter dialog:
(2001, 2007, 2009)
Access tells me that the expression is typed incorrectly or is too complex to be evaluated and then suggests I simplify the expression by assigning parts of the expression to variables. I have tried with brackets around the whole parameter as above, no brackets, brackets around each item - and just to make sure all straws were clutched - quotes around each item.
The query design grid has: In ([Years_Parm]) in the Criteria bit.
I can get it to work with 'Like [Years_Parm]' when I input 200*.
I can get it to work with 'Between [Year_Parm1] And [Year_Parm2]' when I input a start and end year.
I just can't get it to work with 'In ([Years_Parm])'
I want the In operator so I don't have to deal with data from years I don't need (ie 2002-2006 & 2008 in the above)
Any suggestions?
tia,
mcalex