View Full Version : Adding a sum column to a crosstab query


Access9001
03-03-2010, 12:48 PM
I have a crosstab query that outputs the columns Store, FirstNumber, Secondnumber.

I want to also integrate a third column that is equal to the sum of these two fields. Can I do this or do I need a second query?

HiTechCoach
03-03-2010, 04:58 PM
I use crosstab query a lot.

I have posted an example of how I handle it:
Dynamic Report from Crosstab (click here) (http://www.hitechcoach.com/index.php?option=com_docman&task=doc_details&gid=6&Itemid=28)

JamesMcS
03-04-2010, 01:51 AM
Would it be as simple as putting another column in the query design like this?

Thirdnumber: [firstnumber]+[secondnumber]

HiTechCoach
03-04-2010, 09:14 AM
Would it be as simple as putting another column in the query design like this?

Thirdnumber: [firstnumber]+[secondnumber]

James,

Have you tried that in a Crosstab type query?

JamesMcS
03-04-2010, 11:26 PM
I made the assumption that it wouldn't be a crosstab as you can't have more than one value field as far as I know. 9001, how is the data organised then? Which field is the value field? I guess I misunderstood the intended layout....

Rich
03-05-2010, 08:06 AM
I made the assumption that it wouldn't be a crosstab as you can't have more than one value field as far as I know. ....

You can by using expressions instead of the inbuilt options