Good day,
I have a table which has the following fields:
-Payment Amount
-Freq (i.e monthly vs weekly)
-Freq amount (i.e. 2 for ever 2 weeks)
-Start Date
-End Date
I am trying to create query to calculate the total amount for each entry in the table. The total amount would only include full payment cycles between the two dates - i.e if the freq is 1 month, and the Start Date is Jan 1, 2011, and the end Date is Feb 16 2011, and the Amount is $60, the total amount would be $60.
I tried using datediff, but it assumes that there is 1 month between Jan 30 and Feb 1, which of course is incorrect. Does anyone know a better way of doing this?
My only other path-forward would be to calculate the differences in days and then use averages (i.e avg 30.41 days per month).
Thank you
Kavy
I have a table which has the following fields:
-Payment Amount
-Freq (i.e monthly vs weekly)
-Freq amount (i.e. 2 for ever 2 weeks)
-Start Date
-End Date
I am trying to create query to calculate the total amount for each entry in the table. The total amount would only include full payment cycles between the two dates - i.e if the freq is 1 month, and the Start Date is Jan 1, 2011, and the end Date is Feb 16 2011, and the Amount is $60, the total amount would be $60.
I tried using datediff, but it assumes that there is 1 month between Jan 30 and Feb 1, which of course is incorrect. Does anyone know a better way of doing this?
My only other path-forward would be to calculate the differences in days and then use averages (i.e avg 30.41 days per month).
Thank you
Kavy