Dsum and Like

Posted on 2011-10-30
Last Modified: 2012-06-27

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)
Question by:pdvsa

    Author Comment

    here is an exploded view
    (without the like qualifier)

    LVL 33

    Accepted Solution

    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)
    LVL 119

    Expert Comment

    by:Rey Obrero
    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)

    Author Closing Comment

    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.
    LVL 33

    Expert Comment

    What is it you are trying to check for?

    If you tell us that it might simplify the whole thing.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now