Converting a number into Hours and Minutes

G

Guest

If I have a task that takes a total of 78 minutes, how do I create a query to
convert total minutes into hours and minutes? My answer will be 1 hour and
18 minutes.
Thanks
 
G

Guest

Try this --

SELECT [Calls Table].Total_Minutes, ([Total_Minutes]-([Total_Minutes] Mod
60))/60 AS Hours, [Total_Minutes] Mod 60 AS Minutes
FROM [Calls Table];
 
G

Guest

Thank you, this really works well!!!

KARL DEWEY said:
Try this --

SELECT [Calls Table].Total_Minutes, ([Total_Minutes]-([Total_Minutes] Mod
60))/60 AS Hours, [Total_Minutes] Mod 60 AS Minutes
FROM [Calls Table];


Karrie said:
If I have a task that takes a total of 78 minutes, how do I create a query to
convert total minutes into hours and minutes? My answer will be 1 hour and
18 minutes.
Thanks
 
J

John Vinson

If I have a task that takes a total of 78 minutes, how do I create a query to
convert total minutes into hours and minutes? My answer will be 1 hour and
18 minutes.
Thanks

Don't try to store this duration into a Date/Time field - such fields
are designed to store a precise point in time, not a duration.

To *display* your duration, use an expression such as

[Duration] \ 60 & Format([Duration] MOD 60, ":00")

The \ is an integer divide operator; this expression will create a
text string "1:18".

John W. Vinson[MVP]
 

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