Breaking down hours into days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and hours.

Like 32 hours would be broken down into 1 day 8 hours
 
Well, I would really like to see 32 hours break down into 4 days of vacation
myself.

[VacationTime] \ 8 & " days" & [VacationTime] Mod 8 & " hours"
 
integer division: the \ operator, will give you the integer part of the
division result, e.g.:

32 \ 24 = 1

the mod operator will give you the remainder, e.g.:

32 mod 24 = 8

hth

-John
 
I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and hours.

Like 32 hours would be broken down into 1 day 8 hours

Try an expression like

[Hours] \ 24 & " day " & [Hours] MOD 24 & " hours"

as the control source of a textbox.

This seems a bit wierd - as if your employees are expected to work 24
hours a day, and get one "day" of vacation for every 24 hours. Are you
sure you don't want to work on the basis of 8-hour days?

John W. Vinson[MVP]
 
I should have clarified, I work in EMS and one day of vacation equals 24hrs.
We work 24hr shifts.



John Spencer said:
Well, I would really like to see 32 hours break down into 4 days of vacation
myself.

[VacationTime] \ 8 & " days" & [VacationTime] Mod 8 & " hours"


Jeep165 said:
I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and
hours.

Like 32 hours would be broken down into 1 day 8 hours
 
yes, I should have been more clear. I'm a Paramedic, and we work 24hr
shifts. We accumulate 24hrs vacation time per month (actually its seniority
based 24hrs/month for 1-5years service, 30hrs/month for 6-10years service,
36hrs for 11-15...you get the idea.) And when we burn our vacation we use
24hrs at a time. Our sick time is the same way only everyone accumulates
24hrs at a time...regardless of how long you've worked.

While the formula isn't exactly crucial to what I'm doing. It would just
make it a lot quicker and easier to glance and give someone a perspecitve as
to how much time they can have off.



John Vinson said:
I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and hours.

Like 32 hours would be broken down into 1 day 8 hours

Try an expression like

[Hours] \ 24 & " day " & [Hours] MOD 24 & " hours"

as the control source of a textbox.

This seems a bit wierd - as if your employees are expected to work 24
hours a day, and get one "day" of vacation for every 24 hours. Are you
sure you don't want to work on the basis of 8-hour days?

John W. Vinson[MVP]
 
=[txtVacationBalance] \ 24 & " days " & [txtVacationBalance] Mod 24 & " hours"

Works great!!! BUT...I need to display down to the quarter hour... Right
now it just displays days and hours. Like 33.75hrs vacation would show 1 day
10 hours. I need it to show 1 day 9.75hours.

John Spencer said:
Well, I would really like to see 32 hours break down into 4 days of vacation
myself.

[VacationTime] \ 8 & " days" & [VacationTime] Mod 8 & " hours"


Jeep165 said:
I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and
hours.

Like 32 hours would be broken down into 1 day 8 hours
 
Try:

=[txtVacationBalance] \ 24 & " days " & ([txtVacationBalance] -
([txtVacationBalance] \ 24) * 24) & " hours"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeep165 said:
=[txtVacationBalance] \ 24 & " days " & [txtVacationBalance] Mod 24 & " hours"

Works great!!! BUT...I need to display down to the quarter hour... Right
now it just displays days and hours. Like 33.75hrs vacation would show 1 day
10 hours. I need it to show 1 day 9.75hours.

John Spencer said:
Well, I would really like to see 32 hours break down into 4 days of vacation
myself.

[VacationTime] \ 8 & " days" & [VacationTime] Mod 8 & " hours"


Jeep165 said:
I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and
hours.

Like 32 hours would be broken down into 1 day 8 hours
 
Hey that worked perfect!!! So how did I get that so wrong?

Thank you!
Roger

Douglas J Steele said:
Try:

=[txtVacationBalance] \ 24 & " days " & ([txtVacationBalance] -
([txtVacationBalance] \ 24) * 24) & " hours"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeep165 said:
=[txtVacationBalance] \ 24 & " days " & [txtVacationBalance] Mod 24 & " hours"

Works great!!! BUT...I need to display down to the quarter hour... Right
now it just displays days and hours. Like 33.75hrs vacation would show 1 day
10 hours. I need it to show 1 day 9.75hours.

John Spencer said:
Well, I would really like to see 32 hours break down into 4 days of vacation
myself.

[VacationTime] \ 8 & " days" & [VacationTime] Mod 8 & " hours"


I have a DB Form that will calculate an employees total vacation time in
hours. How would like to break that down into the number of days and
hours.

Like 32 hours would be broken down into 1 day 8 hours
 
Back
Top