negative number

Ligaya

Registered User.
Local time
Today, 16:40
Joined
Apr 21, 2007
Messages
49
I have to columns, one showing the total minutes a worker is entitled for breaks and another column for the total breaks actually taken. I ran a query to calculate the extra breaks taken. Some workers took more than the planned break time and should have shown negative numbers, but my query did not show the negative value. How do I show say, minus 10 minutes, etc?

Ligaya
 
how are you calculating the elasped time for each break?
 
negative numbers

The time entered for the total break time taken is automatically entered by a phone system where in when you press the "break button", it counts the time you are away from your desk. The countdown stops when the "break button" is released. The figures are then downloaded automatically to ACCESS. There are times when a staff member takes longer than the prescribe break, hence the negative number. Say, the authorisd break is 45 minutes, but the person actually took 1 hour and 8 minutes.

I have a real problem calculating.
 
to use your example 45 min - 68 mins = -23 minutes
 
I would have both your entitled breaks field and and actual break field defined as number data type rather than date/time data type and have the actual values as seconds. This will then let you have the negative numbers and then convert to minutes and hours on the output.
 
negative numbers

Hello Dennisk,
Thank you so much for the speedy reply. I am still finding my feet with ACCESS. Could you please tell me howto convert the hours/minutes into seconds? I would greatly appreciate every help you can give.
Many thanks,
Ligaya
 
Hours to seconds = ([Number of Hours] * 3600)
Minutes to seconds = (Number of Minutes] * 60)

converting back is a little harder

divide the number of seconds by 3600 Cint([Number Of Secords]/3600) to get hours

then use the mod operator to get the remainder in secords

[Number Of Seconds] mod 3600

this gives you the remainder in seconds

divide this result by 60 to get the number of minutes Cint([Number Of Secords Remaining]/60)

then use the Mod operator to get the number of seconds left.

However there may be an easier way as this is just off the top of my head.
 
converting hours to seconds

Hi Dennisk,

Thank you for the formula. I am under great pressure to finish the query and report so your help is invaluable. Thank you again.

Ligaya
 
conversion hours/minutes to seconds in a query

Hello again,

If I have several rows in a column that is already in minutes, and a couple that has a combination of the hour and minutes (e.g. 1.52), how do I enter in the expression in the query to convert all into seconds?

Please help.

Thanks,
Ligay
 
If you are only working in whole minutes, it would make sense to hold the values as minutes instead of seconds. Subsitute 60 instead of 3600 in the formulae.

The example value of 1.52 - is that 1 hour and 52 minutes or 1 hour and 31 minutes?
 
converting hours to seconds

Hello Neil,

Thanks for answering.
The 1.52 referred to one hour and fifty-two minutes.

Regards,
Ligaya
 

Users who are viewing this thread

Back
Top Bottom