G
Guest
Hello. I've got an Access query that is based on the following logic:
If the day and year of the information was entered is later than the day and
year of the billing due date, the next date to be billed will be one month
after the date the information was entered. If the day and year are earlier,
the next billing date will be the same month as the date the infomation was
entered.
My problem is I can't get the expression right. I keep getting compile
errors. This is what I have.
Next Due Date: IIf(Format([Date Picked Up Table].[Date Picked Up],"mm") &
Format([Next Payment Date],"/dd/yy")<[Date Picked Up Table].[Date Picked
Up],Format(Format([Date Picked Up Table].[Date Picked Up],"mm")+1 &
Format([Next Payment Date],"/dd/yy"),"mm/dd/yy"),Format([Date Picked Up
Table].[Date Picked Up],"mm") & Format([Next Payment Date],"/dd/yy"))
The formula was working before, but I had to change it because it wasn't
working correctly. Example:
Date Picked Up Last Date Billed Next Due Date will be:
12/01/04 08/25/04 12/25/04
05/15/04 03/05/04 06/05/04
Hopefully the examples I gave will help someone here understand my problem.
If the day and year of the information was entered is later than the day and
year of the billing due date, the next date to be billed will be one month
after the date the information was entered. If the day and year are earlier,
the next billing date will be the same month as the date the infomation was
entered.
My problem is I can't get the expression right. I keep getting compile
errors. This is what I have.
Next Due Date: IIf(Format([Date Picked Up Table].[Date Picked Up],"mm") &
Format([Next Payment Date],"/dd/yy")<[Date Picked Up Table].[Date Picked
Up],Format(Format([Date Picked Up Table].[Date Picked Up],"mm")+1 &
Format([Next Payment Date],"/dd/yy"),"mm/dd/yy"),Format([Date Picked Up
Table].[Date Picked Up],"mm") & Format([Next Payment Date],"/dd/yy"))
The formula was working before, but I had to change it because it wasn't
working correctly. Example:
Date Picked Up Last Date Billed Next Due Date will be:
12/01/04 08/25/04 12/25/04
05/15/04 03/05/04 06/05/04
Hopefully the examples I gave will help someone here understand my problem.