Searching by month

blanchard

Registered User.
Local time
Today, 04:45
Joined
Mar 24, 2009
Messages
39
Hello all,
What's the criteria code for searching by month.

I have a list of birthdays like this = 00/00/00.
 
Hi -

Add a calculated field, e.g. Month([OrderDate])

In the criteria cell of this field:
[Enter Month 1-12]

Run the query. You'll be prompted to [Enter Month 1-12]
Enter an integer (1-12) and there you are.

Example query sql:

Code:
SELECT Orders.*
FROM Orders
WHERE (((Month([OrderDate]))=[Enter Month - 1-12]));

HTH - Bob
 
Hello bob,
I now get two message boxes appearing one after the other,
the first says:
Enter Perameter Value
OrderDate

the next:
Enter Month 1-12
 
What I provided was an example, based on Northwind's Orders table (just because this was handy and included a date field).

You need to tailor it your particular table (which probably doesn't include an OrderDate)

Create a query based on your table.
Add a calculated field, e.g. Month([YourDOBField])

In the criteria cell of this field:
[Enter Month 1-12]

Bob
 
Oh erm yes,
I feel a little stupid now...haha

Cheers Bob
 
Ok after reading your posts I have got it to work but when the results show the Field Name changes to Expr1

How do I change it back to Date of Birth?
 

Users who are viewing this thread

Back
Top Bottom