Hello, I have this query:
Expr1: IIf(Year([dtmStartCovg])=[desired year],([mnySurchargePaid]/(DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1))*RowMin((DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1),(DateDiff("d",[dtmStartCovg],[desired end date]))+1),IIf(Year([dtmEndCovg])=Year([desired end date]),([mnySurchargePaid]/(DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1))*(((DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1-(DateDiff("d",[dtmStartCovg],[last day of prev year])+1))))))
and what I want to be able to do is replace the [desired end date] with 12/31/[desired year] and replace [last day of prev year] with 12/31/[desired year]-1 year. For example I would enter 2003 for [desired year] and would replace [desired end date] with 12/31/2003 and replace [last day of prev year] with 12/31/2002.
And if any one could sugest any way to clean this code up a bit Thank you for the time...
David
Expr1: IIf(Year([dtmStartCovg])=[desired year],([mnySurchargePaid]/(DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1))*RowMin((DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1),(DateDiff("d",[dtmStartCovg],[desired end date]))+1),IIf(Year([dtmEndCovg])=Year([desired end date]),([mnySurchargePaid]/(DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1))*(((DateDiff("d",[dtmStartCovg],[dtmEndCovg])+1-(DateDiff("d",[dtmStartCovg],[last day of prev year])+1))))))
and what I want to be able to do is replace the [desired end date] with 12/31/[desired year] and replace [last day of prev year] with 12/31/[desired year]-1 year. For example I would enter 2003 for [desired year] and would replace [desired end date] with 12/31/2003 and replace [last day of prev year] with 12/31/2002.
And if any one could sugest any way to clean this code up a bit Thank you for the time...
David