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

How to pull birthdays for a given date range 1

Status
Not open for further replies.

misha8765

Instructor
May 8, 2006
9
US
Thank you in advance for your help.

In a query, I want to pull all employees who have a birthday in May. Our date field is 99/99/00

I don't care about the year and I don't know the birth year in advance. I just want to know all birthday's for each month.

Any idea how I can write the code in the criteria of the date field?

Thank you

 
Change the birthday field to
MonthDate: Format$([FieldName], "mmmm").

then in the criteria field put [please enter month].

this would require the month be spelled out.

use "mmm" to get the three letter abbreviation, use "mm" to have a 2 digit numeric representation (e.g., 05), and use "m" to have a numeric representation of the minimum digits (e.g., "5")
 
A WHERE clause of the form
Code:
WHERE Month(DateOfBirth) = 5
will give you everyone with a May birthday.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top