Convert hours:minutes to minutes

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

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?
 
Scott said:
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?

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
 
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
 
Back
Top