Time calculations

  • Thread starter Thread starter claw
  • Start date Start date
C

claw

Guest
I have a form that includes two basic fields

1. USDateandTimeStarted
2. USDateandTimeFinished.

The fields include both date and time (date and time are in the same field) i.e. “6/26/2006 4:23pm”. The next field I need to calculate the duration, basically one field minus another…anything I’ve tried will only calculate the time difference will not factor in the days. For example, if it has been 52 hours (2 days, 4 hours) it will only say 4 hours. A few of what I’ve already tried are below. And I’ve also tried an elapsed time expression.

Can anyone provide any guidance.. ? Thanks!

=[USdateandtimestarted]-[USdateandtimefinished]

=DateDiff("n",USDateandtimestarted,USdateandtimefinished)

Glad tidings -

Claw
 
MOD
Returns the remainder after a number is divided by a divisor.

Syntax

MOD(number,divisor)

Number is the number for which you want to find the remainder after the division is performed.

Divisor is the number by which you want to divide Number.
 
Greater than query

Cool, thanks for the guidance. I have one more question...I have an unbound text box that calculates time =CDbl(Now()-[LastStageChange])*24. This obviously displays on my form as hours. I am trying to build a query that returns all records greater than 2 hours.

In my query design view, I am puting =CDbl(Now()-[LastStageChange])*24 in the Field row of a blank Column. Would I add the >2 to the end of this expression or would I put it in the Criteria row of the same column??

Thanks again, claw
 
Hi -

Put it in the criteria cell of your calculated field.

Bob
 
OK, what is up with all this posting in this area?
Is it just me?

This is a FAQ area, you may want to google FAQ as its meaning seems to be lost.

There has been some wierd Sh^& goin' down around here and I am getting a bit concerned (I have to admit I was kinda' intriqued by the russian chick though).

Really, you people have to look past the first catagory you see and actually search for what you need as the people that act as our knowlege base might just get tired one day of your inability to help yourself. And who knows they might even get tired of your dumb A## lazyness and keep it all to themselves.

The point is...
GOD HELPS THOSE, WHO HELP THEMSELVES !!!
And I myself am not sure how I feel about the whole God thing, but if there is a God then I am sure he would not put up with this crap.
 
Thank you DanG for your insightful comments.

Some truly brilliant observations,

Best wishes - Bob
 
Last edited:

Users who are viewing this thread

Back
Top Bottom