Results 1 to 4 of 4
  1. #1
    hehrerh is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    35

    Lightbulb DSUM a calculated field within a query

    Click image for larger version. 
<br /><script async src=
    Name: accessquestion1.png  Views: 13  Size: 206.9 KB  ID: 29802" class="thumbnail" style="float:CONFIG" />


    Hello,

    I have a calculated field within a query. I want to create a column that displays the total original estimate value for that budget line item's accounting category.

    I need to use a calculated field within a query to get to the original estimate because this value includes figures from multiple tables. Were I referencing a value from a TABLE I understand I could use the DSUM function. Is there a function similar to DSUM that can reference only localized fields from within a query?

    Thanks,
    Howie

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I don't use these in queries, they slow the queries down and make things more complicated. Rather crate a second query, with totals by key field, and bring that in to this query.

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    How about a subquery like
    SELECT [some key], SUM([OriginalEstimate)] AS SubtotalOriginalEstimate FROM [your table] GROUP BY [some key];
    Then join the results of that to your query on [some key]?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The aggregate query and joining to data is probably easiest and fast performer.

    Then can build a report with that query and use its Sorting and Grouping features and summary calcs in group and report header/footer sections.

    Can also use domain aggregate function in textbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Summing calculated fields with DSum in a report
    By Carbontrader in forum Reports
    Replies: 3
    Last Post: 01-13-2017, 04:47 PM
  2. Replies: 2
    Last Post: 12-30-2014, 01:32 PM
  3. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  4. Dsum in a calculated field
    By JonathanT in forum Reports
    Replies: 3
    Last Post: 01-22-2011, 08:45 PM
  5. Replies: 1
    Last Post: 05-05-2010, 01:54 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