I have Yes/No column for Discount option. If Yes is checked, than 3% applies.
I am trying to write IIf statement, so if Yes is checked the query calculates how many days left to make a payment to get a discount based on 10 days period. If No is checked, the query calculates how many days left to make a payment based on 30 days period.
When I run this statement
IIf([3% Discount]="Yes",[Bill Date]-Date()+20,"N/A")AS [Discount Days Remaining]
the query returns
#Error
What am I doing wrong?
Here is the complete code
SELECT [Accounts Payable].PaymentID, [Accounts Payable].CustomerID, [Accounts Payable].[Customer Name],
[Bill Date]-Date()+30 AS [Days Remaining],
IIf([3% Discount]="Yes",[Bill Date]-Date()+20,"N/A")AS [Discount Days Remaining],
[Accounts Payable].[Payment Amount], [Accounts Payable].[Bill Date]
FROM [Accounts Payable];
Thank you.
I am trying to write IIf statement, so if Yes is checked the query calculates how many days left to make a payment to get a discount based on 10 days period. If No is checked, the query calculates how many days left to make a payment based on 30 days period.
When I run this statement
IIf([3% Discount]="Yes",[Bill Date]-Date()+20,"N/A")AS [Discount Days Remaining]
the query returns
#Error
What am I doing wrong?
Here is the complete code
SELECT [Accounts Payable].PaymentID, [Accounts Payable].CustomerID, [Accounts Payable].[Customer Name],
[Bill Date]-Date()+30 AS [Days Remaining],
IIf([3% Discount]="Yes",[Bill Date]-Date()+20,"N/A")AS [Discount Days Remaining],
[Accounts Payable].[Payment Amount], [Accounts Payable].[Bill Date]
FROM [Accounts Payable];
Thank you.