Having Trouble with Time format

NJudson

Who farted?
Local time
Yesterday, 22:59
Joined
Feb 14, 2002
Messages
297
I have calculation where I'm trying to get the difference of 2 times and the result isn't what I'm looking for. I'm doing this:

Time1 = recqryMTX160VCHQuery.Field(1)
Time2 = recqryMTX161VCHQuery.Field(1)
TimeDiff = Time2 - Time1

The actual values look like this:

Time1 = 8:15:56 AM
Time2 = 8:16:06 AM
TimeDiff = 8:16:06 AM - 8:15:56 AM

and the result it gives me is 12:00:10 AM

All I want is the number of hrs, mins, secs that the difference is. I would like to see it display 00:00:10 for a result. I can't seem to find anywhere on this forum or the net a correct format to do this. I'd really appreciate anyones thoughts on this. Thanks.

PS:

Is it possible to change the Access Time format to military time? Maybe this would work???

[This message has been edited by NJudson (edited 04-26-2002).]
 
DateDiff("s",[Time1],[Time2]) will give you the number of whole seconds. Then you'll have to build a string expression to put them into racer's format: HH:MM:SS
 
Thanks. It works now. I was searching archives with the wrong keywords before. Shoot, there's a ton of stuff posted before about DateDiff. Sorry, I try to find answers from previous posts before posting one myself but I screwed up my searches. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom