Results 1 to 3 of 3
  1. #1
    dwilson is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Location
    Indianapolis
    Posts
    22

    DSum syntax for report

    DSum function in report
    Can anyone tell me what is wrong with the syntax in this formula in the report footer on my report?
    I keep getting an error

    =DSum("[HP Paid]","PEST","[SERVICE TYPE PEST]=True")

    I have a query named PEST that this report is based on
    I want to sum field HP Paid(currency type field) where the field SERVICE TYPE PEST has a check (it's a Yes/No field)


    I have used DCOUNT functions quite a bit but never tried DSUM.


  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442

    =DSum("[HP Paid]","PEST","[SERVICE TYPE PEST]=-1")

    Yes/No fields are stored as -1 for yes, 0 for no

  3. #3
    dwilson is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Location
    Indianapolis
    Posts
    22

    Dsum

    Found syntax that works:
    =Sum(IIf([SERVICE TYPE PEST]=True,[HP Paid],0))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 12-05-2011, 05:10 AM
  2. DSum Syntax Help
    By desk4tbc in forum Programming
    Replies: 2
    Last Post: 07-01-2011, 02:31 PM
  3. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  4. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 AM
  5. Hide zero value in report and date syntax
    By Alex Motilal in forum Access
    Replies: 0
    Last Post: 11-16-2008, 09:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums