S
Sue
In a query, I have a field (combineddate) based on a union query which
combines 2 dates - dob (date of birth) and doa (date of anniversary). In some
instances, the year is not known and I've used the year "104" for those. With
help from the board, I now have the query returning mm/dd ONLY. I use this
info for a report which lists upcoming dates (sorted by month, then day) in
which I want to remember folks' birthdays and/or anniversaries.
The SQL statement for the union query is:
SELECT LastName, FirstName, "Birthday" As CardType, DOB As CombinedDate
FROM tblContacts
UNION ALL SELECT LastName,FirstName, "Anniversary" As CardType, DOA As
CombinedDate
FROM tblContacts
ORDER BY CombinedDate;
The SQL statement for my "events" query is:
SELECT qryUnionForEvents.LastName, qryUnionForEvents.FirstName,
qryUnionForEvents.CombinedDate, qryUnionForEvents.CardType,
Format(qryUnionForEvents.CombinedDate,"mm/dd") AS EventDate,
Format(qryUnionForEvents.CombinedDate,"mmmm") AS EventMonth,
Format(qryunionforevents.combineddate,"mm") AS EventMonthNumeric
FROM qryUnionForEvents
WHERE (((qryUnionForEvents.CombinedDate) Is Not Null));
I now want to develop a mechanism for teasing out only those events which
will take place within the next 2 weeks. I've tried a variety of different
solutions - for example Between Date() And Date()+14 - but the queries come
up void when I run them. I suspect this is because the years range anywhere
from 104 to 2006.... all of which are dates that occured in the past.
How do I word the expression so that the YEAR will be eliminated from
consideration and only the month and day will be factored in?
Appreciate the help!
combines 2 dates - dob (date of birth) and doa (date of anniversary). In some
instances, the year is not known and I've used the year "104" for those. With
help from the board, I now have the query returning mm/dd ONLY. I use this
info for a report which lists upcoming dates (sorted by month, then day) in
which I want to remember folks' birthdays and/or anniversaries.
The SQL statement for the union query is:
SELECT LastName, FirstName, "Birthday" As CardType, DOB As CombinedDate
FROM tblContacts
UNION ALL SELECT LastName,FirstName, "Anniversary" As CardType, DOA As
CombinedDate
FROM tblContacts
ORDER BY CombinedDate;
The SQL statement for my "events" query is:
SELECT qryUnionForEvents.LastName, qryUnionForEvents.FirstName,
qryUnionForEvents.CombinedDate, qryUnionForEvents.CardType,
Format(qryUnionForEvents.CombinedDate,"mm/dd") AS EventDate,
Format(qryUnionForEvents.CombinedDate,"mmmm") AS EventMonth,
Format(qryunionforevents.combineddate,"mm") AS EventMonthNumeric
FROM qryUnionForEvents
WHERE (((qryUnionForEvents.CombinedDate) Is Not Null));
I now want to develop a mechanism for teasing out only those events which
will take place within the next 2 weeks. I've tried a variety of different
solutions - for example Between Date() And Date()+14 - but the queries come
up void when I run them. I suspect this is because the years range anywhere
from 104 to 2006.... all of which are dates that occured in the past.
How do I word the expression so that the YEAR will be eliminated from
consideration and only the month and day will be factored in?
Appreciate the help!