Query to retrieve Birthdates

betheball

Registered User.
Local time
Today, 03:22
Joined
Feb 5, 2003
Messages
107
I'm stumped on this one. My db has a birthday field. However, the b-days are stored as text in YYYYMMDD format. I need to write a query that will return all records where the birthdate field is within 15 days, before or after the current date. So, I really only need to compare today's month and day to the month and day of the birthdates in the db. Any thoughts?
 
Try this setting in a column in the query grid:-

Field: Right([BirthDate],4)

Show: uncheck

Criteria: Between Format(Date()-15,"mmdd") And Format(Date()+15,"mmdd")


When the query is run today Dec 15, those birthdays falling between Nov 30 and Dec 30 should be returned.
 

Users who are viewing this thread

Back
Top Bottom