none
Access 2010 Crosstab Query Expression--Same Table

    Question

  • I would like to add this expression:

    ([2013]/[2012]-1) AS [Change%]

    As a field to the crosstab query below:

    TRANSFORM

          Sum(Data.Spending)

    SELECT

          Data.Category

    FROM

          Data

    WHERE

          (((Data.Year)="2012" Or (Data.Year)="2013"))

    GROUP BY

         Data.Category

    PIVOT

         Data.Year;


    For my purposes I need to have everything together in one query.

    This is because I am writing SQL in another program, PTReportGen, which uses the query to directly access an Access database.

    Thursday, November 21, 2013 9:56 AM

All replies

  • Hi

    Please don't mind of me, this forum is for Data mining and not for either TSQL or Access/SQL. Please move this to relevant forums for better answers.

    Thanks


    Prav

    Saturday, November 23, 2013 12:35 AM
  • Hi JRob59,

    As Prav said, to get dedicated support for the query statements of Microsoft Access 2010, please ask a question in the following forum:
    http://answers.microsoft.com/en-us/office/forum/access?auth=1.

    I am not familiar with the Reporting tool of PTReportGen. In SQL Server Reporting Services, this requirement can be done easily achieved via expressions in the report.

    Regards,


    Mike Yin
    TechNet Community Support

    Monday, November 25, 2013 6:18 AM