Calculated Control-Expressions

L

Laura

Hello - I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be calculated by 12.
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover.

I have never done this before, so could use help. Thank
you!
 
J

John Vinson

Hello - I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be calculated by 12.

Could you explain "calculated by 12"? Divided by 12, multiplied by 12,
or what...?
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover.

Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32, 0)

or whatever expressions you want: the second expression - in this case

[Hours Worked] - 32

will be used if the first expression is true; if it's false, the third
(0) will be returned instead.
 
L

Laura

Hi John - I'm sorry I was not more clear. It would be
multiplied by 12.

How would I create a second calculated field to store
the carryover number? The way this report works, is that
people work hours each month, and can only be credited
for 32 hours per month. So any hours over 32 in that
month need to go into carryover. And if on a future
month they work less than 32 hours and have some time in
carryover, then the carryover should be used (up to a
maximum of 32 hours of carryover and actual hours for the
month). I hope I'm explaining this correctly.

Hours are entered through timesheets and the report I'm
creating adds the total hours for a specified time period
for: sum([hoursworked]).

If you have ideas on how I can get the report to work, it
would be much appreciated!! Thank you!

Laura.

-----Original Message-----
Hello - I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be calculated by
12.

Could you explain "calculated by 12"? Divided by 12, multiplied by 12,
or what...?
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover.

Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32, 0)

or whatever expressions you want: the second expression - in this case

[Hours Worked] - 32

will be used if the first expression is true; if it's false, the third
(0) will be returned instead.


.
 

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