Query Help

all7holly

Registered User.
Local time
Today, 13:57
Joined
Nov 16, 2011
Messages
49
Hello,

I am trying to return records that are past due if not paid right away when the invoice terms are “Due Upon Receipt” below is the code I’m using. I keep getting an error saying you entered invalid syntax. Any ideas?

PaymentStatus: IIf(Date()-[invoice date sent]>=1 And [tbl report and invoices sending]=[due upon receipt], “Due Upon Receipt Past Due”,

Thanks,
Holly
 
“Due Upon Receipt Past Due”
appears to have the wrong quotation mark characters. Try
Code:
"Due Upon Receipt Past Due"
instead.
Is your syntax fully represented? There is a trailing comma which should have the else part of the IIf statement. It should be something like
Code:
PaymentStatus: IIf(Date()-[invoice date sent]>=1 And [tbl report and invoices sending]=[due upon receipt],"Due Upon Receipt Past Due","alternative choice")
 
This is the full code.


PaymentStatus: IIf(Date()-[invoice date sent]>=1 And [tbl report and invoices sending]=[due upon receipt],“Due Upon Receipt Past Due”,
IIf(Date()-[invoice date sent]>=365,"365 Days Past Due",IIf(Date()-[invoice date sent]>=180,"180 Days Past Due",IIf(Date()-[invoice date sent]>=150,"150 Days Past Due",IIf(Date()-[invoice date sent]>=120,"120 Days Past Due",IIf(Date()-[invoice date sent]>=90,"90 Days Past Due",IIf(Date()-[invoice date sent]>=60 And Date()-[invoice date sent]<90,"61-90 Days Past Due",IIf(Date()-[invoice date sent]>=30 And Date()-[invoice date sent]<60,"31-60 Days Past Due ","Current"))))))))
 
When you get this nested with IIF statements its time to create a function in a module.
 
Did changing the quotation marks help, or did the problem move elsewhere?
 

Users who are viewing this thread

Back
Top Bottom