PDA

Click to See Complete Forum and Search --> : Time elapsed !


Alankar
Jul 4th, 2005, 07:11 AM
Hi All,

I am totally confused now and putining it on the forum now. I am using MS Access.

I have two fields, one is Integer (name Field1) and second is string (name Field2) and have data like 143:25 (hh:mm). Now I want to subtract
Field1-Field2, and the result should be in hh:mm format.

How could I do it, I am doing it in query, So need a formula to get this.

Regards,
Alankar

Ecniv
Jul 4th, 2005, 08:50 AM
Not sure if this will help but... Here goes.

1 (double) = 1 day = 24 Hours
= 1440 minutes

You grab the hours from your text, multiple up for minutes.
Add on any extra minutes.
Divide this total by 1440
This should give you a double value that is the total time.

Example:
((143*60)+25)/1440 = 5.97569444444444

Compare this to your other number (use clng/cint to convert to comparitive type, or store a double of the other total.