Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Differences in Dates 1

Status
Not open for further replies.

healermoon

IS-IT--Management
Nov 9, 2005
20
US
I am working on a calculation where it is determined how long an employee has worked for our company. I don't want to use DateDiff function due to the fact I would like rounding to the nearest tenth.

I have a [date hired] field and [last updated] field, and want the difference betweeen the two. Both fields are in short date format.

Thanks in advance for your help.
 


Hi,

It's as simple as

DaysWorked = [last updated] - [DateHired]


Skip,

[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue]
 
Something like this ?
10 * Round(([last updated] - [date hired]) / 10)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the help guys. I need to know how many years and to the tenth for the next year. If I have the start date of 4/13/02 and the last update (the last time HR updated their db) of 10/25/05, the db needs to have a 3.5, for an output.

Thanks

Kenny Renaud
IT Manager
Corral West Ranchwear Inc.
 
Like this ?
Round((last_updated-date_start)/365.25,1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This got me much closer to the correct out put, THANKS!!!! However the only issue I had, and it may be that I am running Access '97 in our office, is that Round wasn't recognized and the ,1 wasn't recognized.

Kenny Renaud
IT Manager
Corral West Ranchwear Inc.
 
And this ?
((last_updated-date_start+9.9)\36.525)/10

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Therefore the output I am getting is: 3.53456536618754, when it should be only 3.5

Thanks so much I am very grateful for all your help!

Kenny Renaud
IT Manager
Corral West Ranchwear Inc.
 
Can you please post your formula ?
Mine was:
((last_updated-date_start+9.9)[highlight]\[/highlight]36.525)/10

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Looks like we cross posted. This is awesome! The only weird output I have now is:

last updated: 10/25/05
Start date: 10/25/02

which should return a 3 is returning a 2.9 any ideas?

Thanks!!



Kenny Renaud
IT Manager
Corral West Ranchwear Inc.
 
Expr1: (([last updated]-[Start Date]+9.9)\36.525)/10

This is working with the exception noted above.

Thanks.

Kenny Renaud
IT Manager
Corral West Ranchwear Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top