Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Criteria when using DSum function

Results 1 to 2 of 2
Share This Thread →
  1. #1
    Andrew Thorpe is offline Contributing User
    Join Date
    Oct 2007
    Posts
    160
    Rep Power
    21

    Criteria when using DSum function

    Using the DSum function, the criteria section should compare a date . I have written it using inverted commas as I would for text datatypes, but it doesn't work. I've also tried using # signs. Can anyone help in amending the criteria (final) section :

    TotalClaimsThisYear = DSum("NumberOfClaims", "qryRunningTotalClaims", "DateActioned > """ & Me.CompanyStartDate"""" )

    A further question: can you have two criteria in one DSum function? Appreciate any help - thanks.

  2. #2
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    TotalClaimsThisYear = DSum("NumberOfClaims", "qryRunningTotalClaims", "DateActioned > #" & Me.CompanyStartDate & "#" )

    You can use more than one criteria:

    TotalClaimsThisYear = DSum("NumberOfClaims", "qryRunningTotalClaims", "DateActioned > #" & Me.CompanyStartDate & "# and [SecondFieldName] = '" & me.Somerandomtextfield & "'" )

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Using UK date format in dsum criteria
    By bobsmith in forum Microsoft Access Help
    Replies: 4
    Last Post: August 31st, 2011, 05:14 AM
  2. Help with the Dsum function needed
    By coolhandphil in forum Microsoft Access Help
    Replies: 1
    Last Post: September 23rd, 2010, 02:49 PM
  3. Double Criteria for a dlookup function
    By Papa G in forum Microsoft Access Help
    Replies: 3
    Last Post: April 2nd, 2010, 12:55 PM
  4. DLookup function using two combo boxes as criteria
    By SHAWTY721 in forum Microsoft Access Help
    Replies: 1
    Last Post: October 13th, 2007, 05:20 PM
  5. Dsum with Multiple Criteria
    By Thomas Lafferty in forum Microsoft Access Help
    Replies: 1
    Last Post: April 25th, 2006, 03:57 PM

ASP Free Advertisers and Affiliates