• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Dsum and Like

Experts,

I am trying to modify the below Dsum to include a LIKE qualifier (check the bold)...I get a syntax.  

Let me know where I am wrong...thank you

=Nz(DSum("[SumOfApproved Amount In USD Equivalent]","qryLCIssued_Sum_Import-CSM_2","[Guarantor Description] = like &* '" & [txtBankName2] & "'" *& ),0)
0
pdvsa
Asked:
pdvsa
  • 2
  • 2
1 Solution
 
pdvsaProject financeAuthor Commented:
here is an exploded view
(without the like qualifier)


untitled.JPG
0
 
NorieVBA ExpertCommented:
This is how you would add the Like

"[Guarantor Description] Like '*" & [txtBankName2] & "*'"

So you were almost right, just needed the wildcards inside the single quotes.

Here's the full expression with the Like.

=Nz(DSum("[SumOfApproved Amount In USD Equivalent]","qryLCIssued_Sum_Import-CSM_2","[Guarantor Description] Like '*" & [txtBankName2] & "*'"),0)
0
 
Rey Obrero (Capricorn1)Commented:
you don't use "=" and "Like" together, you use only one , "=" or "Like"


=Nz(DSum("[SumOfApproved Amount In USD Equivalent]","qryLCIssued_Sum_Import-CSM_2","[Guarantor Description]  like & '*" & [txtBankName2] & "*'"),0)
0
 
pdvsaProject financeAuthor Commented:
ok that was it.   I will have to ask another question because I think I need a Len I suppose.  The like statement is returning 0 Dsum.
0
 
NorieVBA ExpertCommented:
What is it you are trying to check for?

If you tell us that it might simplify the whole thing.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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