Access query to compare dates

G

Guest

I am making a calendar which has a table of all the days & another with
birthdays + I want to be able to print out a report combining both tables but
the 1st is a full date & the 2nd is just dd mmm. I want the birthdays table
to go into every year, for example Joes birthday is 3rd March which should
show 2006,2007,2008 without having to enter a new record on the birthday
table for each year.
I can't see which funtion to put into a query to see every record in main
table & names from birthdays table for that date.
When I use the relationship of all in main with some in birthdays, it only
puts the birthday name in the current year & not in following years.
Can anyone suggest a query method to achieve this?
 
M

Marshall Barton

henrietta said:
I am making a calendar which has a table of all the days & another with
birthdays + I want to be able to print out a report combining both tables but
the 1st is a full date & the 2nd is just dd mmm. I want the birthdays table
to go into every year, for example Joes birthday is 3rd March which should
show 2006,2007,2008 without having to enter a new record on the birthday
table for each year.
I can't see which funtion to put into a query to see every record in main
table & names from birthdays table for that date.
When I use the relationship of all in main with some in birthdays, it only
puts the birthday name in the current year & not in following years.


If the birth date field is a date type field, then use
something like:

SELECT tblDays.fldDate, tblBirthDays.FldPerson
FROM tblDays LEFT JOIN tblBirthDays
ON Format(tblBirthDays.fldBirthDate, "mmdd")
= Format(Month(tblDays.fldDate, "mmdd")
 

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