G
Guest
How do I return the birthdays in the next 30 days in a date of birth field
How do I return the birthdays in the next 30 days in a date of birth field
John said:On Mon, 24 Jan 2005 02:46:23 -0800, "David Oakey" <David
How do I return the birthdays in the next 30 days in a date of birth field
If you have the date of birth in a field named DOB, use a calculated
field in the query:
HappyHappy: DateSerial(Year(Date()), Month([DOB]), Day([DOB]))
and use a criterion on it of
BETWEEN Date() AND Date() + 30
John W. Vinson[MVP]
John,
Does that work if the current date is Dec 20? I am guessing that you would not
get the January birthdates. I don't have a nice simple solution for this. I
think I saw one posted long ago, but I didn't capture the solution.
Hi JohnJohn Vinson said:Yes, it will work perfectly well. DateSerial() is pretty clever:
?DateSerial(2004, -60, 75)
2/13/1999
In other words, it wraps years, months, days and decades with aplomb.
John W. Vinson[MVP]
Yes I understand that, but try this scenario.
Current Date: Dec 20 2004
Birthdate: Jan 3 1942
HappyHappy: 2004-01-03 is not In Range: 2004-12-20 to 2005-01-19