Full Version: Display beginning of year the entire year
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
khkeener
I have a statistics report that shows a selected time frame (usually a weeks worth of numbers) along with a Year-to-Date time frame. Is it possible to have a query calculate and create a new field that has the beginning of each year show, for this year, 1/01/2007 and then for next year show 1/01/2008 and so on, without any user intervention. This new year field must show this beginning year date conistently the entire year.

Kevin
HiTechCoach
Yes it is possible.

The first date of current year:
DateSerial(Year(Date()), 1, 1)

The first date of next year:
DateSerial(Year(Date())+1, 1, 1)



For more info see:
Functions for calculating and for displaying Date/Time values in Access
khkeener
Thanks for looking at this. I believe that the first piece of code will do the trick. I just need to be able to display 1/01/"currentyear" and this should do that for this year and then when next year rolls around it looks like it will show that date too, and so on. I was looking for something that would calculate this data without needing user intervention and I believe you have answered that.

Thank you again.

Kevin
HiTechCoach
Kevin,

You're welcome!

Glad we could assist.

uarulez2.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.