Time From & To Calculator

abbaddon223

Registered User.
Local time
Yesterday, 16:23
Joined
Mar 13, 2010
Messages
162
Hi all,

Sure this is a simple one :):

I have two fields - [TimeFrom] and [TimeTo] which are storing short times.

Is there a module or query syntax that will calculate the hours / minutes between the two?

Presently I'm running a simple query which is [TimeTo]-[TimeFrom]. This is fine except where I cross 00:00 as it then doesn't work the hours out but just the raw calculation

IE: 20:00 to 05:00 is working out at 15 not 9.

Any help would be greatly appreciated!! Thanks in advance.
 
You'll have to store the date too, even if you store it in a separate field.

([Date2]+[Time2]) - ([Date1]+[Time1])
 
With you - thanks a lot mate!!
 
You'll have to store the date too, even if you store it in a separate field.
And my suggestion is to store it all in the same field. It will make your life much easier as you go to do things in queries and forms, reports, etc. because you won't have to always be bringing them together.

You can use formatting or DateValue and TimeValue to get the parts easy enough, so store the date and time together. At least that's my suggestion.
 

Users who are viewing this thread

Back
Top Bottom