First day of current year

  • Thread starter Thread starter Tara
  • Start date Start date
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!
 
Sorry - this was for Excel. In Access the same must be
=DATE()-DATESERIAL(YEAR(DATE()),1,1)
 
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
 
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())
 
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)
 
Back
Top