Selecting query from date range


G

Guest

i have several queries which have a date range as a filter (between dates) eg
i put in on a form start date: 21 nov 05 and end date 20 nov 06 and the query
filters out all other records.

what im having to do is each year, alter the dates to the current year. eg
business year starts 01 jan 05 ends 31 dec 06.

Does some one know some code where i can just type in 01 jan and 31 dec
without putting in the year and every year the year updating automatically
 
Ad

Advertisements

G

Guest

i have several queries which have a date range as a filter (between dates) eg
i put in on a form start date: 21 nov 05 and end date 20 nov 06 and the query
filters out all other records.

what im having to do is each year, alter the dates to the current year. eg
business year starts 01 Feb 05 ends 31 jan 06.

Does some one know some code where i can just type in 01 feb and 31 jan
without putting in the year and every year the year updating automatically
 
Ad

Advertisements

J

John Vinson

Does some one know some code where i can just type in 01 feb and 31 jan
without putting in the year and every year the year updating automatically

I'm not sure I understand. You want the day and month to be static,
not user input, and the year to change? If so, try

BETWEEN DateSerial(Year(Date()), 2, 1) AND DateSerial(Year(Date()), 3,
0)

to get the whole month of February.

If the date is input by the user, just have them leave off the year.
Typing 2/1 into a date field will automatically fill in February 1 of
the current year.

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