Convert hours:minutes to minutes

Convert hours:minutes to minutes

Post by U2NvdH » Tue, 04 Mar 2008 23:38:00


I have a calculated field in a query that returns the difference between two
times with a time format of h:nn; for example, one hour and thirty minutes is
displayed as 1:30. I need the value of 1:30 displayed in minutes, so I need
to see the value as 90 minutes. If I use the "n" format for minutes it only
returns the minutes without the hours so in the case of 1:30 it only returns
30 and not 90. How do I format or calculate the field to return the value in
minutes so that 1:30=90, 2:45=165, 0:33=33?
 
 
 

Convert hours:minutes to minutes

Post by Tom Lak » Tue, 04 Mar 2008 23:56:35


Are you using n in a Format or in DateDiff?
Your DateDiff function can calculate the difference in minutes:

? datediff("n", #01:00#, #02:30#)
90

Tom Lake

 
 
 

Convert hours:minutes to minutes

Post by U2NvdH » Wed, 05 Mar 2008 00:04:00

I was using format. I changed it to DateDiff as per your example and it
returned the minutes just like I was looking for!

Thank you,

Scott