Two vacation formulas

G

Guest

I am using this

WTime: (DateDiff("d",[HireDate],Now()))/365
and this
VacHrs: Switch([wtime]<1,"0",[wtime] Between 1 And
3,"40",[wtime]<=3,"80",[wtime]<=8,"104",
[wtime]<=10,"120",[wtime]<=15,"144",[wtime]<=17,"160",
[wtime]<=20,"200",[wtime]<=23,"216")
to calculate vacation time.
It works very well however, there is a new contract and less vacation time.
Vacation already earned under old contract will not be taken away. For
example, Ten years service completed July 31, old contract, 120 hours
vacation,Ten years service completed August 1, new contract ,104 hours
vacation.
I am trying to write code , if wtime (time worked) = 10 before august 1
then vacation time is 120, on or after august 1 vacation time would be 104.
Nothing I have tried has worked correctly. Any help would be greatly
appreciated. Thanks
 
M

[MVP] S.Clark

How about two different queries. One for each scenario?

Better yet, how about having a table that maintains your parameters, then
hit the table using query CRITERIA, instead of your pseudo-code?

--
Steve Clark, Access MVP
FMS, Inc.
Call us for all of your Access Development Needs!
1-888-220-6234
(e-mail address removed)
www.fmsinc.com/consulting
 
G

Guest

Thank-you I will work on code using two queries. Using a table sounds like
the better way to go but, its above my skill level.
 

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