Date field query to find same ddmm in ddmmyyyy field

R

Rob

I would like to search our database to find whose
birthday it is on the current day.

Can anyone help?

Rob
 
A

Allen Browne

Use this expression:
(Month([DOB] = Month(Date())) AND (Day([DOB] = Day(Date()))

The expression could go into the WHERE clause of a query, the Filter
property of a Form, or the WhereConditon of the OpenReport action.

The date format does not matter. However, since you are using dd/mm/yyyy
format, you may be interested in reading this article about how to avoid
problems with dates in Access:
http://allenbrowne.com/ser-36.html
 
R

rob

Many thanks
-----Original Message-----
Use this expression:
(Month([DOB] = Month(Date())) AND (Day([DOB] = Day (Date()))

The expression could go into the WHERE clause of a query, the Filter
property of a Form, or the WhereConditon of the OpenReport action.

The date format does not matter. However, since you are using dd/mm/yyyy
format, you may be interested in reading this article about how to avoid
problems with dates in Access:
http://allenbrowne.com/ser-36.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I would like to search our database to find whose
birthday it is on the current day.

Can anyone help?

Rob


.
 

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