Birthday Access query

  • Thread starter Thread starter Plukje
  • Start date Start date
P

Plukje

I have a table called "Clientdata" and a field called "Birthdate". Every
day I'd like to run a query that shows my clients whose birthday it is.
How can I run this query?
 
Add the fields you want included to the design grid of
your Select Query.
Under the Birthdate field put =DATE() in the criteria row.
This will give you today's birthdays.
(You need to have the Birthdate field set as DATE/TIME in
the underlying table.)
Good Luck!
 
Add the fields you want included to the design grid of
your Select Query.
Under the Birthdate field put =DATE() in the criteria row.
This will give you today's birthdays.

Ummm... no. It won't. It will return the people who were born today,
this year only.

Instead, put in a calculated field:

Birthday: DateSerial(Year(Date()), Month([DOB]), Day([DOB]))

where DOB is the date of birth. This will calculate *this year's*
anniversary as a Date/Time value.

You may also want to use a criterion of

BETWEEN Date() AND Date() + 7

to see the coming week's birthdays, just to catch weekends and the
like.
 
Plukje,

If you want people born in previous years, you need to extract the day
and month from the Birthdate. Make a calculated field in the query
like this...
Birthday: Format([Birthdate],"ddmm")
and in the criteria, you can put...
Format(Date(),"ddmm")
I think this will work for all except the 29 Feb people.

- Steve Schapel, Microsoft Access MVP
 
Uh-oh! What was I thinking when I wrote that reply?
My apologies, and thanks, guys, for putting it right!

Time to go home!
-----Original Message-----
Add the fields you want included to the design grid of
your Select Query.
Under the Birthdate field put =DATE() in the criteria row.
This will give you today's birthdays.

Ummm... no. It won't. It will return the people who were born today,
this year only.

Instead, put in a calculated field:

Birthday: DateSerial(Year(Date()), Month([DOB]), Day ([DOB]))

where DOB is the date of birth. This will calculate *this year's*
anniversary as a Date/Time value.

You may also want to use a criterion of

BETWEEN Date() AND Date() + 7

to see the coming week's birthdays, just to catch weekends and the
like.


.
 
Back
Top