Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    Ok I'm gonna give it a try I just have a little bit of editing to do first. Thanks a ton I'll let you know how it goes.

  2. #17
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    When you say do a crosstab query using:
    TRANSFORM Sum(qryFinancialInfo.Amount) AS SumOfAmount
    SELECT qryFinancialInfo.Category, Sum(qryFinancialInfo.Amount) AS [TotalOfAmount]
    FROM qryFinancialInfo
    GROUP BY qryFinancialInfo.Category
    PIVOT Format([Date],"yyyy");

    Don't you mean a union query???

  3. #18
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    Also, I changed Gross Margin to GrossMargin in my Table as well as my SQL Union Query. Then I tried to run a union query with the info you posted and it says "reserved error (-5500), there is no message for this error". Should I undo my changes to the Gross Margin? Thanks

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    No, TRANSFORM is a crosstab query. The queries I posted work with the table you provided (populated it with data). Create the UNION and then use it in the Crosstab.

    Changing the field name should not be an issue. Just make sure the queries reflect that change. I made the change without issue.
    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.

  5. #20
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    Ok I'm having trouble understanding the TRANSFORM Crosstab query. I have put data in my financial info table. I have the UNION query that contains this:

    SELECT "Revenue" As Category, [Date], Revenue As Amount
    FROM [Financial Info]
    UNION SELECT "GrossMargin", [Date], GrossMargin
    FROM [Financial Info]
    UNION SELECT "EBITDA", [Date], EBITDA
    FROM [Financial Info];

    So am I supposed to make another UNION query and do a crosstab between the 2 unions? Or just another crosstab query with the info you gave me? I'm confused on where I should enter this data:

    TRANSFORM Sum(qryFinancialInfo.Amount) AS SumOfAmount
    SELECT qryFinancialInfo.Category, Sum(qryFinancialInfo.Amount) AS [TotalOfAmount]
    FROM qryFinancialInfo
    GROUP BY qryFinancialInfo.Category
    PIVOT Format([Date],"yyyy");

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Review post #15 again.
    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.

  7. #22
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    I've reviewed post #15 I'm just having trouble understanding how to make the crosstab query. Do I use the query wizard and query design? I'm confused as to where I'm typing this in: TRANSFORM Sum(qryFinancialInfo.[Amount]) AS SumOfAmount
    SELECT qryFinancialInfo.[Entity], qryFinancialInfo.[Category], Sum(qryFinancialInfo.[Amount]) AS [Total Of Amount]
    FROM qryFinancialInfo
    GROUP BY qryFinancialInfo.[Entity], qryFinancialInfo.[Category]
    PIVOT Format([Date],"yyyy");

    Do I type this in the criteria of query design view?

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You could use the query wizard for crosstab or you can open query designer in SQL View and copy/paste the SQL statement from the post into the editor. Then switch to Design View and see how it is structured in the grid

    Be sure to use the revised Union query I show in post #15. Think I was editing as you posted subsequent post and that is why I suggested you review it again, if you haven't.
    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.

  9. #24
    Luke is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    72
    It's starting to come together. My problem now is that when I try to run the query, it says it doesn't recognize "Date" as a valid field name/expression and it also says there's a syntax error in TRANSFORM statement.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-12-2010, 12:00 PM
  2. Access to Excel: Financial Forecasting Tool
    By BLUE_CHIP in forum Import/Export Data
    Replies: 2
    Last Post: 06-19-2010, 01:52 PM
  3. Change Financial Quater Periods
    By scorched9 in forum Access
    Replies: 0
    Last Post: 01-26-2010, 08:38 PM
  4. Date manipulaton for Financial Year
    By Neil Bingham in forum Access
    Replies: 0
    Last Post: 02-15-2009, 11:24 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