View Full Version : Horizontal Sum in crosstab query


mrolt
09-26-2001, 04:23 AM
I've created a crosstab query with countries as row headings and each of their fiscal quarter results as column headings.

Is there any way of setting up a field to automatically calculate the annual total for each row (ie. the sum of the four quarters)??

Your help would be appreciated.

PearlGI
09-26-2001, 08:01 AM
Hi.

The following should help:

TRANSFORM Sum(VALUE) AS [The Value]
SELECT Country, Sum(VALUE) AS [Total Of VALUE]
FROM {TableName}
GROUP BY Country
PIVOT FiscalQuarter;

This will add an extra RowHeading with the Total of the Quarters.

HTH http://www.access-programmers.co.uk/ubb/wink.gif