I have a report I am trying to complete.
This is the line that I am having a problem with.
=IIf([Expr2]>=240,240,[Expr2])
This line feeds information into a text box on my report.
Here is how it works -
It is taking data from a vacation/sick report in the same database Expr2 represent the amount of sick hours a person has accrued with 240 being the max. If expr2 is >=240 then show 240 in the text box, if not then show the current balance.
My problem is that each month people accrue 4 more hours which pushes them even farther over the max of 240. If more than one month has passed and they have accrued more hours then they have taken the amount never drops below 240 and they stay maxed out, when it is suppose to subtract what ever they have taken from 240 and show the new balance.
How do I get this to work as follows
If Expr2>=240,then 240-taken amount, else Expr2.
What would really help is if someone would tell me how to set the max at 240 and the to have the current taken amount subtracted from 240 if they have reached their max.
I know this looks like a mess, but you guys have helped me with bigger messes than this, so I'm counting on you once again.
Thank you in advance
This is the line that I am having a problem with.
=IIf([Expr2]>=240,240,[Expr2])
This line feeds information into a text box on my report.
Here is how it works -
It is taking data from a vacation/sick report in the same database Expr2 represent the amount of sick hours a person has accrued with 240 being the max. If expr2 is >=240 then show 240 in the text box, if not then show the current balance.
My problem is that each month people accrue 4 more hours which pushes them even farther over the max of 240. If more than one month has passed and they have accrued more hours then they have taken the amount never drops below 240 and they stay maxed out, when it is suppose to subtract what ever they have taken from 240 and show the new balance.
How do I get this to work as follows
If Expr2>=240,then 240-taken amount, else Expr2.
What would really help is if someone would tell me how to set the max at 240 and the to have the current taken amount subtracted from 240 if they have reached their max.
I know this looks like a mess, but you guys have helped me with bigger messes than this, so I'm counting on you once again.
Thank you in advance