Results 1 to 2 of 2
  1. #1
    WhatTheFrick is offline Novice
    Windows Vista Access 2007
    Join Date
    Feb 2013
    Posts
    5

    Show summed annual total and current month value on same row

    Using Access 2007 w/ mdb in 2003 format. Trying to create report that, per person, and on the same line, has an annual total (sum(MoneyField) where DateField between #1st Date# and #last Date#) and also the CURRENT month value (this comes from a control on a form, so MoneyField where DateField = FormControl).



    So, in a table that has fields:

    Person
    Money
    Date

    I need to have report that shows:

    Person AnnualTotal CurrentMonthValue

    I can't use saved queries, I need to do this w/ SQL strings at runtime (although typically to get my strings I just design queries and then view them in SQL view).
    I tried using calculated controls, but could not get this to work.

    Can someone advise on best way to do this? Do I need to nest queries, or use subreports?

    Thanks for any help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Do you want the report to show only one line per person?

    Options:

    1. Do an aggregate query of the filtered dataset that sums by person.

    2. Use domain aggregate function (DSum, DCount, DAvg, etc).

    3. Combination of the above.

    Why can't you use saved queries? What are you basing the report on? Using code to modify the RecordSource SQL?

    Can't be more specific without a better understanding of your database.
    Last edited by June7; 05-07-2013 at 04:35 PM.
    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. Unbound Combobox show current month
    By burrina in forum Forms
    Replies: 1
    Last Post: 03-08-2013, 01:57 AM
  2. Replies: 0
    Last Post: 12-01-2012, 05:35 PM
  3. Total divided by weekdays in a month
    By normie in forum Access
    Replies: 1
    Last Post: 03-22-2012, 07:09 PM
  4. Current Month and Year-To-Date
    By DSnipeFunk in forum Access
    Replies: 4
    Last Post: 05-31-2011, 11:38 AM
  5. Total no of days in a month
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 10-15-2006, 01:05 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