Birthday queries

T

Tacco

I wanted to set criteria to retrieve birthdays . let's
say those pople whose birthday is in november.
someone told me to put birthmonth: month
([birthdayfield]). but it is not working.
Can someone tell me step by step. I am not that good with
access.
 
G

Guest

In your query, add a new field which goes like this:

=month([birthdayfield])
(obviously change it to the name of your field)

Then in the criteria of this new field, put in 11 if you
want those with November birthdays, 1 if you want January
birthdays, etc...
 
M

M Skabialka

Search Help for:
Format Property - Date/Time Data Type
User-Defined Date/Time Formats (Format Function)
Format Function Example
etc

m Display the month as a number without a leading zero (1 - 12). If m
immediately follows h or hh, the minute rather than the month is displayed.
mm Display the month as a number with a leading zero (01 - 12). If m
immediately follows h or hh, the minute rather than the month is displayed.
mmm Display the month as an abbreviation (Jan - Dec).
mmmm Display the month as a full month name (January - December).

MyStr = Format(Date, "Long Date")
MyStr = Format(MyTime, "h:m:s") ' Returns "17:4:23".
MyStr = Format(MyTime, "hh:mm:ss AMPM") ' Returns "05:04:23 PM".
MyStr = Format(MyDate, "dddd, mmm d yyyy") ' Returns "Wednesday, ' Jan 27
1993".

Format([birthdayfield],"mmm") would return "Nov"
Format([birthdayfield],"m") would return 11

SELECT Format([birthdayfield],"mmm") AS birthmonth, tblMyTable.*
FROM tblMyTable
WHERE (Format([birthdayfield],"mmm")="Nov");

HTH
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top