First day of current year

T

Tara

I have a query that I need to use to pull data between
the first day of the current year to the current date.
Is there a way to have access pull the data automatically
without having to actually set the criteria manually?
For example, I know to get data for the current day or
from a specific day to the current day is "Between
#Whatever Day# and Date()...Is there something similar to
Date() that works for the first day of the year?

Thanks!
 
A

Arvi Laanemets

Sorry - this was for Excel. In Access the same must be
=DATE()-DATESERIAL(YEAR(DATE()),1,1)
 
G

Guest

Try the DateSerial function. Your criteria would look something like

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

HT

----- Tara wrote: ----

I have a query that I need to use to pull data between
the first day of the current year to the current date.
Is there a way to have access pull the data automatically
without having to actually set the criteria manually?
For example, I know to get data for the current day or
from a specific day to the current day is "Between
#Whatever Day# and Date()...Is there something similar to
Date() that works for the first day of the year

Thanks
 
F

fredg

I have a query that I need to use to pull data between
the first day of the current year to the current date.
Is there a way to have access pull the data automatically
without having to actually set the criteria manually?
For example, I know to get data for the current day or
from a specific day to the current day is "Between
#Whatever Day# and Date()...Is there something similar to
Date() that works for the first day of the year?

Thanks!

Since you are always wanting records for the whole current year, how
about just using:

Where Year([DateField] = Year(Date())
 
J

John Vinson

Is there something similar to
Date() that works for the first day of the year?

Yes:

DateSerial(Year(Date()), 1, 1)

For the first of the current month you can use

DateSerial(Year(Date()), Month(Date()), 1)
 

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