Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 66
  • Last Modified:

Wrong number of arguments

Experts,

I am trying to combine 2 separate statements that work into an iif.  I am getting a wrong number of arguments.  I have split them out separately to test and they work but when I combine them I get the error.  
Grateful for your help...

=IIf([PaymentMadeYN] <> "Yes",DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt], DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt] & " and PaymentMadeYN = '" & [PaymentMadeYN] & "'")+DSum("Amount","tblRePayment","DrawIDrpmt = " & [DrawIDrpmt] & " and PaymentMadeYN = 'Yes'"))
0
pdvsa
Asked:
pdvsa
1 Solution
 
Ryan ChongCommented:
quick try:
=IIf([PaymentMadeYN] <> "Yes", DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt]), DSum("Amount","tblDraws_Details1","ID = " & [DrawIDrpmt] & " and PaymentMadeYN = '" & [PaymentMadeYN] & "'")+DSum("Amount","tblRePayment","DrawIDrpmt = " & [DrawIDrpmt] & " and PaymentMadeYN = 'Yes'") 

Open in new window

0
 
pdvsaAuthor Commented:
there was a  missing paren in your answer and I added it at the end of statement and it worked perfectly.  thank you
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now