Turning Decimal time into HH.MM.SS format

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

Scott Graham

I have a query setup which gives me cetain times in decimal format using
certain cod *24* within my query. I have based a report on this query but i
want to be able to show the decimal time into the time format above? I have
tried going into properties and use Long time, short time, medium time
without success. Any suggesions would be welcomed.

Thanks
 
What properties? Where?

Have you tried using the Format() function on a "field" in your query
definition?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I have a query setup which gives me cetain times in decimal format using
certain cod *24* within my query.

What is "certain cod *24* "?
 
Sorry, never clearly explained. the expresion I am using within my query is
"Hours: Sum(([time elapsed]*24))". thus giving me the time elapsed as a
decimal e.g. 0.123 of an hour. Within my report I would like to change this
to Time format e.g. 10mins etc...
 
Post sample data that would be in [time elapsed].
What is the DataType of the field?
--
KARL DEWEY
Build a little - Test a little


Scott Graham said:
Sorry, never clearly explained. the expresion I am using within my query is
"Hours: Sum(([time elapsed]*24))". thus giving me the time elapsed as a
decimal e.g. 0.123 of an hour. Within my report I would like to change this
to Time format e.g. 10mins etc...

Scott Graham said:
I have a query setup which gives me cetain times in decimal format using
certain cod *24* within my query. I have based a report on this query but i
want to be able to show the decimal time into the time format above? I have
tried going into properties and use Long time, short time, medium time
without success. Any suggesions would be welcomed.

Thanks
 
Format(CDate(.123/24)"nn:ss")

OR .123 * 60

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Scott said:
Sorry, never clearly explained. the expresion I am using within my query is
"Hours: Sum(([time elapsed]*24))". thus giving me the time elapsed as a
decimal e.g. 0.123 of an hour. Within my report I would like to change this
to Time format e.g. 10mins etc...

Scott Graham said:
I have a query setup which gives me cetain times in decimal format using
certain cod *24* within my query. I have based a report on this query but i
want to be able to show the decimal time into the time format above? I have
tried going into properties and use Long time, short time, medium time
without success. Any suggesions would be welcomed.

Thanks
 
Example of hours below whcih i want turned into HH:mm:SS format

Hours
0.05
3.33333333333333E-02
0.166666666666667
0.583333333333333
1.05555555555556E-02
0.295
0.429444444444444
0.114444444444444
0.639444444444444
0.227222222222222
0.166666666666667
2.16694444444444
0.166666666666667
8.33333333333333E-02


John Spencer said:
Format(CDate(.123/24)"nn:ss")

OR .123 * 60

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Scott said:
Sorry, never clearly explained. the expresion I am using within my query is
"Hours: Sum(([time elapsed]*24))". thus giving me the time elapsed as a
decimal e.g. 0.123 of an hour. Within my report I would like to change this
to Time format e.g. 10mins etc...

Scott Graham said:
I have a query setup which gives me cetain times in decimal format using
certain cod *24* within my query. I have based a report on this query but i
want to be able to show the decimal time into the time format above? I have
tried going into properties and use Long time, short time, medium time
without success. Any suggesions would be welcomed.

Thanks
 
Scott said:
Example of hours below whcih i want turned into HH:mm:SS format

Hours
0.05
3.33333333333333E-02
0.166666666666667
0.583333333333333
1.05555555555556E-02
0.295
0.429444444444444
0.114444444444444
0.639444444444444
0.227222222222222
0.166666666666667
2.16694444444444
0.166666666666667
8.33333333333333E-02


If the total hours can ever be greater than 23, then use:

Int(Hours) & ":" & (Hours * 60) Mod 60 & ":" & (Hours *
3600) Mod 60
 
Back
Top