Convert hours:minutes to minutes

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?
 
T

Tom Lake

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
 
S

Scott

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top