Date calculation in Query

cubsguy

New member
Local time
Today, 10:42
Joined
Jun 8, 2005
Messages
9
YearsOfService: DateDiff("d",[Employee]![SIV Date],Date())/365

First I'm calculating the current Years of Service. SIV Date = Hired Date

Then I would like to calculate the years of service as of 12/31/"Current Year", where the Current Year would not require updating every year and 12/31 would be constant.

I'm just not sure how to specify the Month/Day and use Current Year not hard coded. I could set up a user defined date for that half of the calc but my users are not really bright and allowing them to simply click a button is my only option there.

Ultimately I will compare the 2 years of Service numbers to determine if there will be a change in the level of vacation accrual an individual receives during the year. The only part I have issue with is coding that date. Thanks for the help.
 
Thank you very much. I was actually missing a parenthase.
YearsOfService2: DateDiff("d",[Employee]![SIV Date],"12/31/" & Year(Date()))/365

Needed 3 right only had 2. It's amazing how easy it is to miss the little things. Although I wasn't sure what I was doing, I was pretty close. Thanks for the help!
 

Users who are viewing this thread

Back
Top Bottom