T
Tara
I'm trying to create a query that will calculate how much someone has
contributed year-to-date to their supplemental health care plan. Basically
the employee agrees to contribute an amount of their choosing. This amount
is then divided out so that the individual pays a certain portion of that out
of each bi-weekly paycheck. The part that is causing me headaches is that we
want to stop calculating a running total for those employees who terminate,
and instead calculate their contributions only up to their termination date.
Here's what I have so far:
This is what I had originally and it works great to calculate the YTD
amount, but doesn't take into account terminated employees:
ytd:
IIf(Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)>[tbl125]![curContrib],[tbl125]![curContrib],Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26))
Then, I tried to modify that so that terminations were taken into account.
It keeps giving me error messages (and with good reason I'm sure, since I
have a feeling I'm approaching this all wrong). Here is that version:
ytd: IIf([TerminationDate] Is
Null,IIf(Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)>[tbl125]![curContrib],[tbl125]![curContrib],Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)),
IIf(Int(([TerminationDate]-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26))
Any help is appreciated!
contributed year-to-date to their supplemental health care plan. Basically
the employee agrees to contribute an amount of their choosing. This amount
is then divided out so that the individual pays a certain portion of that out
of each bi-weekly paycheck. The part that is causing me headaches is that we
want to stop calculating a running total for those employees who terminate,
and instead calculate their contributions only up to their termination date.
Here's what I have so far:
This is what I had originally and it works great to calculate the YTD
amount, but doesn't take into account terminated employees:
ytd:
IIf(Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)>[tbl125]![curContrib],[tbl125]![curContrib],Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26))
Then, I tried to modify that so that terminations were taken into account.
It keeps giving me error messages (and with good reason I'm sure, since I
have a feeling I'm approaching this all wrong). Here is that version:
ytd: IIf([TerminationDate] Is
Null,IIf(Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)>[tbl125]![curContrib],[tbl125]![curContrib],Int((Date()-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26)),
IIf(Int(([TerminationDate]-[tbl125]![dtmPlanStart])/14)*([tbl125]![curContrib]/26))
Any help is appreciated!