search date/time by including all years?

F

folkstar

How do I search date/time only by mm/dd and include all years?
ex. I'm setting up a birthday qry that will automatically pull up all
birthdays for the current and/or next month by using [enter start date]. But
I want access to include all years, so that the user only has to type in mm/dd
 
P

Pieter Wijnen

create a query SELECT NAME FROM EMP WHERE FORMAT(BIRTHDATE,"mmyyyy") =
forms!MyForm!TheDate
type of thing

HTH

Pieter
 
J

John Vinson

How do I search date/time only by mm/dd and include all years?
ex. I'm setting up a birthday qry that will automatically pull up all
birthdays for the current and/or next month by using [enter start date]. But
I want access to include all years, so that the user only has to type in mm/dd

Put in a calculated field by typing:

Happy: DateSerial(Year(Date()), Month([Birthdate]), Day([Birthdate]))

This will be this year's birthday anniversary, and can be searched
using a criterion such as

BETWEEN Date() AND DateAdd("ww", Date(), 1)

to get the birthdays for the coming week.

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

Top