Results 1 to 5 of 5
  1. #1
    smatchymo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2019
    Posts
    15

    DSum meeting multiple criteria

    I'm working on creating my very first Access project and I'm using a personal budget database. I would like a format that I can view monthly summary data in, and I don't think a traditional report will work for my needs. I'm looking for more of an analysis page than something with repeating fields. I'm still fleshing out what I'd like on it, but basically:
    • the total for the month
    • how that compares to previous years
    • how it compares to the monthly average for the year
    • the monthly average of previous years
    • year to date
    • year to date comparison to previous years


    I have a query that shows the TransactionAmount, TransactionYear, and TransactionMonth among a few other relevant fields. Can I get what I want on a report with a DSUM, or do I need a separate query for each year's worth of transactions? I had tried
    Code:
    =DSum("[TransactionAmount]","qryAllTransactions","TransactionMonth = 5" And "TransactionYear = 2019")
    and that gave me a number, but I'm not sure what that represented. It definitely wasn't the sum of transactions from 5/2019.

    Also, is a report the best choice for what I want? Would a form be better? As far as I can tell it wouldn't really matter for this type of project. Thanks in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Too many quotes. Try

    =DSum("[TransactionAmount]","qryAllTransactions","TransactionMonth = 5 And TransactionYear = 2019")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Oh, and form/report may not matter. As a general rule most of us use forms to work with data (add/edit/delete), reports to present it. You might also look at totals queries, which would be more efficient than numerous DSum() functions for each month, etc.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    smatchymo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2019
    Posts
    15
    Awesome, thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Help! Stuck on DSUM with multiple criteria...
    By tbraswell in forum Access
    Replies: 2
    Last Post: 01-03-2019, 10:13 AM
  2. DSUM with multiple criteria
    By Bkper087 in forum Access
    Replies: 4
    Last Post: 02-13-2017, 10:19 PM
  3. DSum with multiple criteria not resetting
    By ms13103 in forum Queries
    Replies: 3
    Last Post: 02-04-2016, 09:34 AM
  4. Value from DSUM with multiple criteria wrong
    By maxmaggot in forum Reports
    Replies: 4
    Last Post: 04-12-2014, 05:21 PM
  5. How to use a create a DSum with multiple criteria
    By FlyingDisc in forum Reports
    Replies: 1
    Last Post: 01-05-2011, 08:31 PM

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