Filter a Report

I'm probably going about this the wrong way, but I'm trying to filter a report to show only hourly employees in a date range.  The date range works fine, [Date]>=[Beg] And [Date]<=[End]
But when I add [Date]>=[Beg] And [Date]<=[End] And [Budget]![ID]="djm" Or "gna" Or "jtv" Or "mdw" Or "mtc" nothing works, not eve the date filter.  "Budget" is my query and "ID" is the employee ID in the Budget Query.  
Macro.pdf
davcosAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
Try:


[Date] >= [Beg] AND [Date] < [End] AND [Budget].ID IN ("djm", "gna", "jtv", "mdw", "mtc")

BTW, [Date] is a reserved word and should not be used as a field name, try something a bit more descriptive.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
davcosAuthor Commented:
Very nice!  Thank you very much!
Dale FyeOwner, Developing Solutions LLCCommented:
Just so you know, the IN( ) clause can be very slow to process if you have large recordsets or a large number of items in the parenthesis.  As an alternative, I will frequently have a table which would contain all of the ID values and a Yes/No field ([IncludeThis], viewed as a checkbox).  I then join this table to my other query on the ID field, and use the [IncludeThis] field to identify which records should be selected.  This runs much quicker than using the IN (  ) clause.

With this method, I can popup a continuous subform which contains the ID fields and the checkbox, rapidly check/uncheck those IDs I want include in the results, and don't have to worry about the fact that I have hard-coded values into the IN ( ) clause (which can be a problem if you want to change the users whose information is included in the report).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.