Results 1 to 2 of 2
  1. #1
    wongray is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2008
    Posts
    6

    CrossTab Query with Moving Dates


    Hello,

    I like to create a crosstab query that will allow me to show the future month in the report.

    example: In Apr 2012 report. it will show below.

    Target Product - May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr
    Product A - 10,20,0,10,10,20,11,10,10,10,11,20

    In May 2012
    Target Product - Jun, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr, May
    Product A - 20,0,10,10,20,11,10,10,10,11,20,10

    Anyway to do a moving months in a Crosstab Query?

    Many Thanks
    Ray

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    That is the issue with crosstabs using dates as column headers, they are so dynamic. Stablizing them is not easy. I would probably do a VBA solution. This thread http://forums.aspfree.com/microsoft-...ry-322123.html has example of VBA code that 'transposes' data to horizontal (left to right) output.
    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. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  2. Soring dates in a crosstab
    By Nicolayd in forum Access
    Replies: 1
    Last Post: 07-12-2011, 08:42 AM
  3. Replies: 5
    Last Post: 09-10-2010, 10:07 AM
  4. Replies: 1
    Last Post: 07-30-2010, 10:28 AM
  5. Select query for Exponential Moving Average.
    By krishna79 in forum Queries
    Replies: 0
    Last Post: 01-22-2009, 05:52 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