If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Converting a number into Hours and Minutes
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 |
#2
|
|||
|
|||
Converting a number into Hours and Minutes
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" wrote: 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 |
#3
|
|||
|
|||
Converting a number into Hours and Minutes
Thank you, this really works well!!!
"KARL DEWEY" wrote: 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" wrote: 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 |
#4
|
|||
|
|||
Converting a number into Hours and Minutes
On Tue, 10 Oct 2006 10:07:02 -0700, Karrie
wrote: 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] |
#5
|
|||
|
|||
Converting a number into Hours and Minutes
Karl,
how would I convert someting like 7125 to 1:58:45? -- -The Novice Learn Today, Teach Tomorrow Great Success is ones ability to ask for Help. "KARL DEWEY" wrote: 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" wrote: 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 |
#6
|
|||
|
|||
Converting a number into Hours and Minutes
Try this --
Int(Int([Seconds]/60)/60) AS [Hour], (([Seconds]-([Seconds] Mod 60)) Mod 3600)/60 AS [Minute], [Seconds] Mod 60 AS [Second] Someone else probably has something better. "TheNovice" wrote: Karl, how would I convert someting like 7125 to 1:58:45? -- -The Novice Learn Today, Teach Tomorrow Great Success is ones ability to ask for Help. "KARL DEWEY" wrote: 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" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|