OK, I made it work. Here is the code
SELECT [Accounts Payable].PaymentID, [Accounts Payable].CustomerID, [Accounts Payable].[Customer Name],
IIf([Customer Name]="Petty Cash","N/A",([Bill Date]-Date()+27)) AS [Payment Deadline],
IIf([Customer Name]="Petty Cash"," N/A", IIF([3% Discount]=No...