A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Converting a number into Hours and Minutes



 
 
Thread Tools Display Modes
  #1  
Old October 10th, 2006, 06:07 PM posted to microsoft.public.access.queries
Karrie
external usenet poster
 
Posts: 17
Default 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  
Old October 10th, 2006, 06:26 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old October 10th, 2006, 07:00 PM posted to microsoft.public.access.queries
Karrie
external usenet poster
 
Posts: 17
Default 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  
Old October 11th, 2006, 01:29 AM posted to microsoft.public.access.queries
John Vinson
external usenet poster
 
Posts: 4,033
Default 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  
Old November 29th, 2006, 06:31 PM posted to microsoft.public.access.queries
TheNovice
external usenet poster
 
Posts: 67
Default 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  
Old November 29th, 2006, 09:53 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.