SOLVED

Dcount Multiple Criteria

Steel Contributor

Hello Experts, 

I am trying to add an additional criteria but I am not getting the result I expect.  I am not getting any error messages but it returns "yes" for each record and that is not correct so I assume something is off.  [Invoice No Stripped] is a text field.  

 

Do you see anything wrong?  The field names have spaces and they are not my names.  

 

InFBL1NInvStrip: IIf(DCount("*","Import_Excel_FBL1N","[Invoice No Stripped] ='" & [Invoice No Stripped] & "'" And "[Amount in doc curr] = " & [Invoice amount])>0,"Yes","No")

 

thank you

2 Replies
best response confirmed by Tony2021 (Steel Contributor)
Solution
InFBL1NInvStrip: IIf(DCount("*","Import_Excel_FBL1N","[Invoice No Stripped] ='" & [Invoice No Stripped] & "' And [Amount in doc curr] = " & [Invoice amount])>0,"Yes","No")
Perfect. I see where the issue is.
"[Invoice No Stripped] ='" & [Invoice No Stripped] & "'"
should be:
"[Invoice No Stripped] ='" & [Invoice No Stripped] & "'

very tricky. thank you. It works great!
1 best response

Accepted Solutions
best response confirmed by Tony2021 (Steel Contributor)
Solution
InFBL1NInvStrip: IIf(DCount("*","Import_Excel_FBL1N","[Invoice No Stripped] ='" & [Invoice No Stripped] & "' And [Amount in doc curr] = " & [Invoice amount])>0,"Yes","No")

View solution in original post