Unable to figure out Error with Comma

proballin

Registered User.
Local time
Today, 13:16
Joined
Feb 18, 2008
Messages
105
I have the following code in the expression builder:
=IIF(ISERROR(IIF(AND(([Month1]>=Now()),IIF(SUM([Past])-[Balance]<0,IIF([Month1]>=[Delivery From],[Balance]/[PartitionEq]))),[Balance]/[PartitionEq],0)),0,IIF(AND(([Month1]>=Now()),IIF(SUM([Past])-[Balance]<0,IIF([Month1]>=[Delivery From],[Balance]/[PartitionEq]))),[Balance]/[PartitionEq],0))+IIF([Month1]<+Now(),[Month1Cars])


However I cannot seem to get it to run due to this error below:
"The expression you entered contains invalid syntax
You may have entered a comma without a preceding value or identifier."

Suggestions?
 
You might get more help if you explain exactly what you are trying to get at. Just looking at it is difficult because it can be parsed in a few different ways. What is the IsError part? What part is it looking at?
 
I may be wrong, but that use of AND looks like Excel syntax rather than Access. In Access it would be:

IIf(A = B AND C = D,TruePart, FalsePart)
 
Sorry bout the confusion Bob...but the error was occuring specifically on this part:

(AND(([Month1]>=Now()),IIF(SUM([Past])-[Balance]<0,IIF([Month1]>=[Delivery From],[Balance]/[PartitionEq])))

Good observation pbaldy...I'mma try out what you said and report back.
 
You were correct pbaldy. I changed it and it worked fine. Thanks!
 
No problem, glad we got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom