Hello,
I have a table that includes a baseline Monthly Recurring Charge, and all the months of the fiscal year, starting with october and ending with September. I used a statement to prorate any discontinues by using the "due date" field as a refernce, then zero out all months afterward. It looked like this:
These were combined in a large SQL statement.
I then successfully reversed it for use with Start Actions.
Finally, I am now trying to change it to use the "due date" for a change action. As an example I'll use November. This would leave the [Month MRC] alone for the months before the due date (November), prorate the month in which the due date occurs by taking the current MRC (November MRC) times the number of days in the month that will expire before the due date, then take the number of days that will expire after the due date times the new MRC (Which will be in [Total MRC(Baseline)]) and add them together to get that prorated rate for that month, then carry out the baseline MRC for the rest of the fiscal year.
I am struggling with the correct statement. This is what I have so far:
I have a table that includes a baseline Monthly Recurring Charge, and all the months of the fiscal year, starting with october and ending with September. I used a statement to prorate any discontinues by using the "due date" field as a refernce, then zero out all months afterward. It looked like this:
Code:
October MRC: IIf(Format([tblISCCSAsbaseline].[due date],"mm")=10,IIf(Format([tblISCCSAsbaseline].[due date],"dd")>=30,Format([tblFinImpact].[Total MRC (Baseline)],"$#,###.00"),Format(((Day([tblISCCSAsbaseline].[due date]))/30)*[tblFinImpact].[Total MRC (Baseline)],"$#,###.00")),IIf(Format([tblISCCSAsbaseline].[due date],"mm")>10 Or Format([tblISCCSAsbaseline].[due date],"mm") Between 1 And 9,Format([tblFinImpact].[Total MRC (Baseline)],"$#,###.00"),0))
November MRC: IIf(Format([tblISCCSAsbaseline].[due date],"mm")=11,IIf(Format([tblISCCSAsbaseline].[due date],"dd")>=30,Format([tblFinImpact].[Total MRC (Baseline)],"$#,###.00"),Format(((Day([tblISCCSAsbaseline].[due date]))/30)*[tblFinImpact].[Total MRC (Baseline)],"$#,###.00")),IIf(Format([tblISCCSAsbaseline].[due date],"mm")>11 Or Format([tblISCCSAsbaseline].[due date],"mm") Between 1 And 9,Format([tblFinImpact].[Total MRC (Baseline)],"$#,###.00"),0))
...
September MRC: IIf(Format([tblISCCSAsbaseline].[due date],"mm")=9,IIf(Format([tblISCCSAsbaseline].[due date],"dd")>=30,Format(0+[NRC],"$#,###.00"),Format((((30-Day([tblISCCSAsbaseline].[due date]))/30)*[tblFinImpact].[total mrc (baseline)])+[NRC],"$#,###.00")),Format([tblFinImpact].[total mrc (baseline)],"$#,###.00"))
I then successfully reversed it for use with Start Actions.
Finally, I am now trying to change it to use the "due date" for a change action. As an example I'll use November. This would leave the [Month MRC] alone for the months before the due date (November), prorate the month in which the due date occurs by taking the current MRC (November MRC) times the number of days in the month that will expire before the due date, then take the number of days that will expire after the due date times the new MRC (Which will be in [Total MRC(Baseline)]) and add them together to get that prorated rate for that month, then carry out the baseline MRC for the rest of the fiscal year.
I am struggling with the correct statement. This is what I have so far:
Code:
November MRC1: IIf(Format([tblISCCSAsbaseline].[due date],"mm")=10,IIf(Format([tblISCCSAsbaseline].[due date],"dd")>=30,Format([November MRC],"$#,###.00"),Format((30-Day([tblISCCSAsbaseline].[due date])/30)*([tblFinImpact].[total mrc (baseline)])+((Day([tblISCCSAsbaseline].[due date])/30)*([November MRC])),"$#,###.00")),IIf(Format([tblISCCSAsbaseline].[due date],"mm")>10,Format([tblFinImpact].[total mrc (baseline)],"$#,###.00",Format([November MRC]),"$#,###.00")))))