Year to Date date restrictor

G

Guest

Hi,

I want to create a year to date date restrictor. Right now for all of my
queries I have used between 1/1/05 and 12/31/05. I want to create one that
will automatically roll over to the next year raither than changing it to
1/1/06 and 12/31/06. Can anyone help?

Thanks,
 
R

Rick Brandt

ChuckW said:
Hi,

I want to create a year to date date restrictor. Right now for all
of my queries I have used between 1/1/05 and 12/31/05. I want to
create one that will automatically roll over to the next year raither
than changing it to 1/1/06 and 12/31/06. Can anyone help?

Thanks,

BETWEEN DateSerial(Year(Date()), 1,1) AND Date()
 
F

fredg

Hi,

I want to create a year to date date restrictor. Right now for all of my
queries I have used between 1/1/05 and 12/31/05. I want to create one that
will automatically roll over to the next year raither than changing it to
1/1/06 and 12/31/06. Can anyone help?

Thanks,

Where Year([DateField] = Year(Date())
or
Where Format([DateField],"yyyy") = Format(Date(),"yyyy")
or
Where [DateField] Between DateSerial(Year(Date()),1,1) and Date()
or if some of your records are dated into the future of the current
year ...
Where [DateField] Between DateSerial(Year(Date()),1,1) and
DateSerial(Year(Date()),12,31)
 

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