Results 1 to 2 of 2
  1. #1
    gkaro is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    18

    Query Help

    Hi, Im new at this so please forgive my simple question.

    I Have a table

    Budget (1=actual 2=Target)
    Retailer
    YR (Year)
    Sales#

    I would like to create a query that outputs the following 6 colums

    YR / Retailer / SumActual Sales / SumTarget Sales / Variance(Actual-Budget) / Variance%(Actual/Target-1)

    I cant seem to get this to work.


    thanks for your help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Try 3 queries:

    First query selects only the actual budget records.

    Second query selects only the target budget records.

    Third query joins the first two on the year and retailer fields. Use this query as the source for calculations. Or better, use it as RecordSource for a report and use the report's Grouping & Sorting with aggregate calcs functionality.

    Assumes the budget/retailer records will be in pairs.
    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.

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