Calculate a projected finish time from start time

R

RichieB

Hopefully someone can help me please.

Ok heres the problem I have a start date and time and need to add hours to
this to display a projected finish time.

I have done this with (start date + hours) and this works, but if i need to
add hours over 24 it will not allow me.

any ideas?

Im using a general date field at the moment.
 
O

Ofer Cohen

Check help on the function DateAdd and the options you have in it

e.g: for adding houres
DateAdd("h",24,[Start Date])
 
D

Douglas J. Steele

The problem is that the date/time data type is intended to store timestamps
(i.e.: a particular date and time), not time durations.

The normal approach is to determine the smallest granularity you require in
your durations (minutes? seconds?), and to store the durations as long
integers represent those units. (i.e: you'd stored 25:03:23 as 90203
seconds). You can write your own functions to convert back and forth between
h:n:s and total seconds.

I did show how to add times together and exceed 24 hours in my October, 2003
"Access Answers" column in Pinnacle Publication's "Smart Answer", but
realisitically that's a kludge. If you're interested, you can download the
column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html
 
Top