How to multiply number of hours by number?

J

Jon

Hi,

How to multiply number of hours by a number? For example , if I have a total
number of 165 and 45 min(165:45) and I need to multiply by 34. How to do that
and how to input 165:45 in a table?

Thanks
 
N

narasimhapuli

Just take time as 165.45 and 34.
for Example ( If a man works 165 hours and 45 min. for Each hour he get Rs.
34.00 then just take 165.45 * 34 )

If he is getting every second then convert all the hours into seconds...
and calculate...
 
T

Tom van Stiphout

On Sat, 21 Mar 2009 03:06:11 -0700, Jon

Turn it into a floating point value, and store it in a Single field.
mySingle = Hours + Min/60

-Tom.
Microsoft Access MVP
 
J

John Spencer

You want to store a duration of time. If you want to do this in one
field you are going to have to decide on the units you want to store.
Pick one: Hours, Minutes, or Seconds.

165 hours and 45 minutes is 165.75 hours.
Or you could store the total number of minutes.
165 hours and 45 minutes is 9945 minutes


If you store just hours you will need to store fractional parts of an hour.
Calculation will be
WorkHours * 34

If you store just minutes (total minutes) the calculation will be
WorkMinutes * 34 / 60

Another option is to use two fields - one to store hours and one to
store minutes (Partial hours).
If you use two fields the calculation would be
(WorkHours + WorkMinutes/60) * 34

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

Tom van Stiphout

On Sat, 21 Mar 2009 04:14:02 -0700, Jon

From the fractional hours you can go back to hh:mm in several ways,
for example:
dim h as integer
dim m as integer
dim mySingle as Single
mySingle = 165.75
h = int(mySingle)
m = (mySingle-h)*60
debug.print h & ":" & format(m,"00")

-Tom.
Microsoft Access 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