Date/Time formating problem

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hello All,

I am logging the amount of time in minutes that it takes to do a particular
task. I have the time that a task was started and the duration for the
amount of time that was taken. What I would like to do is store the amount
in minutes and also show how many hours/minutes the task took. For e.g.

I spent 186 minutes doing a particular task. 186 is stored as a long in my
table (field name is lngDuration). How can i format this number to show on
my report as:

186 Minutes (3 hours 6 minutes)

so far i have a text box with its control source set to

=[lngDuration] & "Minutes "

this is as far as i can get, does someone know how i can format 186 to get
the hours and mins?

Thanks,

Neil.
 
Use the following in your reports or forms...

=[lngDuration]\60 & Format([lngDuration] Mod 60, "\:00")
 
Neil said:
Hello All,

I am logging the amount of time in minutes that it takes to do a particular
task. I have the time that a task was started and the duration for the
amount of time that was taken. What I would like to do is store the amount
in minutes and also show how many hours/minutes the task took. For e.g.

I spent 186 minutes doing a particular task. 186 is stored as a long in my
table (field name is lngDuration). How can i format this number to show on
my report as:

186 Minutes (3 hours 6 minutes)

so far i have a text box with its control source set to

=[lngDuration] & "Minutes "

this is as far as i can get, does someone know how i can format 186 to get
the hours and mins?

Try...

=[lngDuration]\60 & " Hours " & [lngDuration] Mod 60 & " Minutes"
 
Thanks,

Thats exactly what i was after.

Neil.

Rick Brandt said:
Neil said:
Hello All,

I am logging the amount of time in minutes that it takes to do a particular
task. I have the time that a task was started and the duration for the
amount of time that was taken. What I would like to do is store the amount
in minutes and also show how many hours/minutes the task took. For e.g.

I spent 186 minutes doing a particular task. 186 is stored as a long in my
table (field name is lngDuration). How can i format this number to show on
my report as:

186 Minutes (3 hours 6 minutes)

so far i have a text box with its control source set to

=[lngDuration] & "Minutes "

this is as far as i can get, does someone know how i can format 186 to get
the hours and mins?

Try...

=[lngDuration]\60 & " Hours " & [lngDuration] Mod 60 & " Minutes"
 
Back
Top