Thanks to both of you, and I ask for your patience, but where do I put
the
code:
SELECT *
FROM tblTest
WHERE DateSerial(Year(Date()), Month(DOB),Day(DOB))
Between Date() and Date() + 15
OR DateSerial(Year(Date()), Month(DOB),Day(DOB))
Between DateAdd("yyyy",-1,Date()) and DateAdd("yyyy",-1,Date()) + 15
I am still learning VBA
:
Pardon me,
One problem with that is running it Between December 17th and December
31st
where you won't get the results you expect. For instance, DOB is
January
3, 2000. If I run the original criteria, I won't see this birthday.
I
think this modification to the criteria will solve this.
SELECT *
FROM tblTest
WHERE DateSerial(Year(Date()), Month(DOB),Day(DOB))
Between Date() and Date() + 15
OR DateSerial(Year(Date()), Month(DOB),Day(DOB))
Between DateAdd("yyyy",-1,Date()) and DateAdd("yyyy",-1,Date()) + 15
message
SELECT tblTest.*
FROM tblTest
WHERE
(((DateSerial(Year(Date()),Month([TestTime]),Day([TestTime])))>=Date()
And
(DateSerial(Year(Date()),Month([TestTime]),Day([TestTime])))<=Date()+15));
In query design view, the expression in the Field row looks like
this
...
DateSerial(Year(Date()),Month([TestTime]),Day([TestTime]))
... while the expression in the Criteria row looks like this ...
=Date() And <=Date()+15
--
Brendan Reynolds
I cannot find the query expression that I need to find the birthdays
'between
today-15 and today+15'. The problem of course, is that I have to
be
able
to
ignore the year in order to get the day and month to only apply to
the
filter.
Can someone help?