My Assistant
![]() ![]() |
|
|
Oct 25 2007, 11:25 AM
Post
#1
|
|
|
UtterAccess Guru Posts: 634 From: Texas, then Kansas, now Michigan |
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 |
|
|
|
Oct 25 2007, 11:32 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 18,396 From: Oklahoma City, Oklahoma |
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 |
|
|
|
Oct 25 2007, 12:14 PM
Post
#3
|
|
|
UtterAccess Guru Posts: 634 From: Texas, then Kansas, now Michigan |
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 |
|
|
|
Oct 25 2007, 02:36 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 18,396 From: Oklahoma City, Oklahoma |
Kevin,
You're welcome! Glad we could assist. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/uarulez2.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 06:01 AM |