# Thread: Parameter query question on dates

1. Registered User
Join Date
May 2006
Posts
28

## Unanswered: Parameter query question on dates

I have a date field in my table that is formatted DD-MMM-YY and I have to make a query that pulls up all the records in certain months (All the records with a January date, all the records with a February date, etc.) but I'm having trouble with how to do that. I'm pretty sure I need to make a parameter asking which month I want to pull up but I'm lost after that. Any ideas?

2. Registered User
Join Date
Feb 2004
Location
Wales
Posts
343
create a query containing the field with the dats to search between and put in this

Between [From] And [to date]

that reports the btween dates -

hope that helps

Gareth

3. Registered User
Join Date
May 2006
Posts
28
That worked. Thanks!

edit:

Actually, I have to do that on a calculated field now and it's not working because I don't know what to put in as the "Field". I tried putting the actual calculation in there but it didn't work. Any ideas?
Last edited by anejoh; 07-11-06 at 17:54.

4. Registered User
Join Date
Feb 2004
Location
Wales
Posts
343
can you put a small example of the database on here with sample data and Ill help
or email me what you have and Ill look at it for you

gareth

garethfx@aol.com

5. Registered User
Join Date
Jul 2006
Posts
2
Here's what I came up with.
Assume your table is called tblOrders, and your date field is called [OrderDate].

Sample query:
SELECT tblOrders.OrderID, tblOrders.OrderDate FROM tblOrders
WHERE (Month(tblOrders.OrderDate)=10)

This will extract all orders with order dates in October (month 10)

6. Registered User
Join Date
May 2006
Posts
28
Thanks for your help everyone. I got a suggestion from somebody and it worked. Problem solved!

DateMonth: Month([datefield]) for Expression

[Enter Month] in criteria. (it has to be in numbers though 1 for Jan, 2 for Feb, etc.)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•