Query design

G

Guest

I have a database that includes an employee table with birthdays. The
company requested that a report be compiled to reflect birthdays monthly. I
know that a query must be done on the table so the birthdays for each month
can be printed; however I do not know the format for the query. The fields I
would use would be FirstName, LastName, and Birthday. I don't want to show
the year in the birthday and would like to be able to have the report printed
each month? Can I create a query that could be printed each month?
 
A

Allen Browne

Create a query based on this table.

Type this into a fresh column in the Field row:
BirthMonth: Month([birthdays])

You can now create a report grouped by BirthMonth.

To display the birthday on your report without showing the year, just set
the Format property of the birthdays text box to:
mmm d
 
J

John Vinson

I have a database that includes an employee table with birthdays. The
company requested that a report be compiled to reflect birthdays monthly. I
know that a query must be done on the table so the birthdays for each month
can be printed; however I do not know the format for the query. The fields I
would use would be FirstName, LastName, and Birthday. I don't want to show
the year in the birthday and would like to be able to have the report printed
each month? Can I create a query that could be printed each month?

Sure. Use a Query selecting the name fields; in a vacant Field cell
type

HappyHappy: DateSerial(Year(Date()), Month([Birthday]),
Day([Birthday]))

This field will contain this year's birthday anniversary.

You can put a criterion on the field of
= DateSerial(Year(Date()), Month(Date()), 1) AND < DateSerial(Year(Date()), Month(Date()) + 1, 1)

to retrieve all birthdays in the current month.

John W. Vinson[MVP]
 

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

Similar Threads


Top