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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for all records within a chosen month

Status
Not open for further replies.

kevmullet

Technical User
Feb 12, 2002
56
GB
I'm trying to create a query that will return all records that meet the criteria of a month chosen by the user.

Background:

I have a number of records that show when a customer needs invoicing.
I want to be able to search the records for, say, march, and get all of the records that month.

At the moment we can only find out what is due in the next 30 days, using a <Date()+30 criteria.

Any help greatly appreciated
 


You have not provided enough input. What are the table layouts? Multiple tables? What does your current query look like??


[hammer]

 
In the date field of your query try this:

Code:
Between [Enter Begin Date] And [Enter End Date]

This will do what you want, but depending on your situation it may not be the best solution. For example, it can be pretty annoying entering the beginning and ending dates if you have to do it endlessly. On the other hand, it is infinitely flexible if you ever need a period other than a month.

One other caution: I've experienced trouble in Access where the program would be very pick about whether Years were entered as YY or YYYY, so if your query doesn't respond correctly the first time, try changing your Year input.

BTW- I'm using Access 2002 on Win XP. Also, if you are using an older version, it seems like I recall a time when you needed to surround dates with # signs, in which case your formula would look like this:

Code:
Between [#Enter Begin Date#] And [#Enter End Date#]


Hope this helps!
Tim
 
Thanks guys nailed it in the end.

I was trying criteria of Month([Enter Month]) but that was returning no records.

So i had to create another field in the query to make the month part searchable

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top