Results 1 to 4 of 4
  1. #1
    seth.murphine is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    charlotte nc
    Posts
    26

    Date Range Report

    With the attached db, how would I create a report that puts each dlDate across the page header if I put in a date range while cross tabbing visually dlTBAA, dlTBAC and dlTBNC down the side with each of their date totals for the dates across the top?reports.accdb

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Would have been nice to test with data, even dummy values.

    See if this gets you somewhere:

    Query1: yp_UNION, there is no wizard or designer for UNION, must type in the SQL View of query designer.
    SELECT ID, "TBAA" As Type, dlDate, dlTBAA As dlData FROM yp_team_dl
    UNION SELECT ID, "TBAC", dlDate, dlTBAC FROM yp_team_dl
    UNION SELECT ID, "TBNC", dlDate, dlTBNC FROM yp_team_dl;

    Query2:
    TRANSFORM Sum(yp_UNION.dlData) AS SumOfdlData
    SELECT yp_UNION.Type
    FROM yp_UNION
    WHERE (((yp_UNION.dlDate) Between #1/1/2012# And #1/3/2012#))
    GROUP BY yp_UNION.Type
    PIVOT yp_UNION.dlDate;
    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.

  3. #3
    seth.murphine is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    charlotte nc
    Posts
    26
    So theoretically this should give me the query to pull a report that looks like the following?http://prntscr.com/8fv6k

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Try:
    SELECT ID, "TBAA" AS Type, "Week" & " " & Format(DatePart("ww",[dlDate]),"00") & " " & Year([dlDate]) AS WkYr, dlDate, dlTBAA AS dlData FROM yp_team_dl
    UNION SELECT ID, "TBAC", "Week" & " " & Format(DatePart("ww",[dlDate]),"00") & " " & Year([dlDate]) AS WkYr, dlDate, dlTBAC FROM yp_team_dl
    UNION SELECT ID, "TBNC", "Week" & " " & Format(DatePart("ww",[dlDate]),"00") & " " & Year([dlDate]) AS WkYr, dlDate, dlTBNC FROM yp_team_dl;

    TRANSFORM Sum(yp_UNION.dlData) AS SumOfdlData
    SELECT yp_UNION.Type
    FROM yp_UNION
    WHERE (((yp_UNION.dlDate) Between #1/1/2012# And #1/3/2012#))
    GROUP BY yp_UNION.Type
    PIVOT yp_UNION.WkYr;
    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. Date Range Report with Multiple Date Fields
    By StevenCV in forum Reports
    Replies: 13
    Last Post: 02-29-2012, 08:29 AM
  2. Getting a date range to show on a report
    By recon2011 in forum Reports
    Replies: 3
    Last Post: 01-10-2012, 01:27 PM
  3. Code to combine report filter and date range
    By rhubarb in forum Reports
    Replies: 17
    Last Post: 10-28-2011, 03:08 PM
  4. Replies: 13
    Last Post: 09-27-2010, 03:10 PM
  5. Define a date range for a report - Help
    By Optimus_1 in forum Access
    Replies: 4
    Last Post: 06-02-2010, 04:50 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