Birthday

unclefink

Registered User.
Local time
Today, 12:36
Joined
May 7, 2012
Messages
184
I was wondering if someone could help me. I am trying to create a query to pull up people whose birthday is today in a different year. In my table, there is a field for DOB but when I use "Date()" as the criteria it comes up empty, presumably because nobody's birthday is todays date. How can I create the query to search only the Month/Date and exclude the year and show me a result with people whos birthday is today?
 
Try using the Format method.. Something like..
Code:
WHERE Format([[COLOR=Blue]DOB_FieldName[/COLOR]],"dd/mm")=Format(Date(),"dd/mm");
you need to match the highlighted part to match your field name..
 
try this as your criteria, replacing [DOB] with [name-of-your-DOB-field]:

NZ(DateSerial(Year(Date()), Month([DOB]), Day([DOB]),"")

i may be off, but i think that should do it.

EDIT: scratch that.. doesn't work.. my bad. i'm still learning, myself :P
 
Last edited:
This should do it;
Code:
Bday: IIf(Format([dob],"dd/mm")=Format(Date(),"dd/mm"),"Birthday Today! " & Format(Date(),"yyyy")-Format([dob],"yyyy") & " Years Old",Null)
 
I appreciate all the help; however have one issue trying to apply this. I am not at all familiar with coding. Where do I put this "Code" string at?
 
Disregard that last. I placed the "code" provided by mattkorguk and it works perfectly. Its a bit more than what I was looking for but even better.
 
Great stuff, and my first 'Thank you'. Happy to help.
 

Users who are viewing this thread

Back
Top Bottom