Forum Discussion

talmrubin2's avatar
talmrubin2
Copper Contributor
Jan 07, 2021

Crosstab Query Totals

Is there a way to save the totals line for a Crosstab query in Datasheet view so when I run the query the total are there and I do not need to press the 'Totals' button?

    • talmrubin2's avatar
      talmrubin2
      Copper Contributor

      George_HepworthAfter I run the cross tab query, i need to press the 'Totals' button at the top each time. Is there a way to default so that the it totals when i run the query?

       

       

       

      • George_Hepworth's avatar
        George_Hepworth
        Silver Contributor

        talmrubin2 

        Thanks for clarifying. Not that I know of. However, I would not do it that way anyway.

        I would do this as a UNION query. 

        The first SELECT in the UNION is as you have it know.

        Then UNION and a second SELECT that does the totals by NOT grouping on Delivery Te? and Shipping Code. I would need to see the actual SQL from your crosstab to attempt an example. However, where you have SELECT [Delivery Te?], you would use "Totals" AS [Delivery Te?], and where you have [Shipping Code*], you would use "" AS [Shipping Code*] to suppress the Grouping on those fields but still have a placeholder value to display.

        If you need more details, please provide the actual SQL from the Crosstab query to work with.

Resources