Results 1 to 2 of 2
  1. #1
    eskybel is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    74

    Sum Invoiced Amounts between dates in Control Source?

    Hello,

    I have a table that holds all sales, by customer, including forecasted and invoiced amounts, in "periods," essentially the year, and the month in a single number, like 201301 means January 2013.
    Ex:
    CustNum CustName Period Forecast Invoiced
    1 Bob 201301 100 95
    1 Bob 201302 100 105
    1 Bob 201303 100 110
    1 Bob 201401 150 155
    1 Bob 201402 150 145
    1 Bob 201403 150 140

    What I'd like to do is make a query/report that will make a quarterly review of each customer, comparing each year, showing growth/loss percent.

    Ex:
    CustNum CustName LY Qtr 1 Forecast LY Qtr 1 Invoiced CYQtr 1 Forecast CY Qtr 1 Invoiced Growth LY/CY Invoiced
    1 Bob 300 310 450 440 30%

    Easy way to do this? Essentially, I'd like to take a date range in the table, group them with something like =iif([Period]>=201301 and <=201303,sum([Invoiced])), in the Control Source on the report, or with a query I can tie the report to...if that makes any sense?

    Thanks,
    Adam
    Last edited by eskybel; 04-12-2014 at 08:57 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Need a year and quarter identifiers then do a CROSSTAB query.

    One way to calculate quarter from your data: Choose(Right([Period],2),1,1,1,2,2,2,3,3,3,4,4,4)

    However, designing a report to run perpetually based on crosstab is not easy. CROSSTABs are so dynamic, especially with dates as column headers. Review http://allenbrowne.com/ser-67.html
    Last edited by June7; 04-13-2014 at 10:29 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. Replies: 5
    Last Post: 09-18-2013, 09:15 PM
  2. Help with Control Source
    By love2waltz in forum Access
    Replies: 1
    Last Post: 05-18-2012, 01:09 PM
  3. Replies: 5
    Last Post: 10-13-2011, 03:36 PM
  4. control source
    By nashr1928 in forum Forms
    Replies: 5
    Last Post: 03-12-2011, 09:31 PM
  5. Control Source
    By sarah54 in forum Access
    Replies: 1
    Last Post: 03-07-2011, 09:00 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