Finding who has a birthday today (1 Viewer)

cunnie

Registered User.
Local time
Today, 19:41
Joined
Apr 11, 2002
Messages
24
How do I create a query to return all members who's Date Of Birth matches todays date (apart from the year), to show members who have birthdays today.
 

cunnie

Registered User.
Local time
Today, 19:41
Joined
Apr 11, 2002
Messages
24
The search helped a little, I did some searching elsewhere and found the solution:


In the design view of a select query, add the fields you want the query to display, plus your DOB field. You do not need anything in the criteria of any of the fields.

Then in a blank column, enter the Field name as:

Format([DOB],"mm/dd")
(where DOB is the name of the field that holds the date of birth.)

Then in the criteria enter:

Format(Date(),"mm/dd")


Hope this helps make this issue slightly more clear :)
 
Last edited:

raskew

AWF VIP
Local time
Today, 13:41
Joined
Jun 2, 2001
Messages
2,734
Here's something you can play with, changing table/field names as necessary. Since you might want a little advance notice, it returns those who have birthdays during a given month.

SELECT LastName, FirstName, DatePart("m",[dob]) AS bMonth, DatePart("d",[DOB]) AS bDay,
Trim([firstname])+" "+[lastname] AS Expr3, DateSerial(Year(Now()),([bMonth]),[bDay]) AS Birthday
FROM tblStaff
WHERE (((DatePart("m",[dob]))=[enter month (1-12)]))
ORDER BY DatePart("m",[dob]), DatePart("d",[DOB]);
 

Users who are viewing this thread

Top Bottom