Hello,
I have what I believe amounts to a Date Serial issue. I have the following
columns in my table:
Hire-Date
Hire-Year
WTD-RATE
Wks-in-Yr
I need to create a calculation for PTO using these fields. If the person was
hired before 2005, their PTO would be calculated as [Weighted Rate] * [Wks-in-
Yr] * 40. If they were hired after 1/1/05, they are subject to different
parameters - if hired before 3/30: [Weighted Rate] * [Wks-in-Yr] * 10, if
hired before 6/30: [Weighted Rate] * [Wks-in-Yr] * 20, if hired before 9/30:
[Weighted Rate] * [Wks-in-Yr] * 30, else: [Weighted Rate] * [Wks-in-Yr] * 40.
I've written the following script:
PTO: IIf([HIRE-YEAR]<2005,((40*[WTD-RATE])/[TBLDAYSOFWEEK.WKS-IN-YR]),IIf(
[HIRE-DATE]<DateSerial(Year(Date()),3,31),((10*[WTD-RATE])/[TBLDAYSOFWEEK.WKS-
IN-YR]),IIf([HIRE-DATE] Between (DateSerial(Year(Date()),3,31)) And
(DateSerial(Year(Date()),6,30)),((20*[WTD-RATE])/[TBLDAYSOFWEEK.WKS-IN-YR]),
IIf([HIRE-DATE] Between (DateSerial(Year(Date()),6,30)) And (DateSerial(Year
(Date()),9,30)),((30*[WTD-RATE])/[TBLDAYSOFWEEK.WKS-IN-YR]),((40*[WTD-RATE])/
[TBLDAYSOFWEEK.WKS-IN-YR])))))
My problem is that I need to do these calculations prospecitively so Access
will only pro-rate these calculations in the year the person is hired. So if
I was hired in Aug 2005, my PTO would be pro-rated for 2005 but I would
receive the whole amount for 2006.
Any help would be very much appreciated!
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200602/1