Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform IN Query with Parameter in Access 2003

Status
Not open for further replies.

barnard90

IS-IT--Management
Mar 6, 2005
73
US
I am using Access 2003 database.

I have an employee table with fields
Empno, EmpName, Day_worked fields

Day_worked have values like 'Sunday', 'Monday', Tuesday'..etc

I am trying to parameterized query a table like

Select * from Employees where
Day_worked In ([P1])

Here P1 is a parameter where I can pass on multiple values like 'Sunday', 'Monday' ,'Tuesday'...etc at the same time
How can I do it . At present I am able to pass only one value. I would like to pass multiple values at same time.

thanks
 



Day worked as STRINGS equaling the day of week???

What happends NEXT week?

How do you know the DATES worked?

I think you have a problem in your table design.

Short answer, Parameters cannot fill an IN statement, VBA Can.

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
The day_worked has the values of the day in the week
They are like Sunday , Monday , Tuesday...etc
They are not numerics like 10th, 11th, 12th etc

Could I have a single parameter in MS access 2003 which would yield me a single query from a single a paramter like

Select * from Emoloyees where day_worked IN
('Sunday','Monday','Tuesday','Wednesday','Friday')

Please suggest
 



"They are like Sunday , Monday , Tuesday...etc"

I already got that.

What happens when LAST week, and the week before that AND the week before that, I worked MONDAY & TUESDAY & WEDNESDAY & THURSDAY & FRIDAY, but not THIS WEEK?

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
WHERE InStr(',' & P1 & ',', ',' & Day_worked & ',') > 0

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top