row total of crosstab

  • Thread starter daniellchiu via AccessMonster.com
  • Start date
D

daniellchiu via AccessMonster.com

here is what i have got

SELECT "JAN" as Mth , id, quan, type
FROM tablejan
UNION ALL select "FEB", id, quan, type
from tablefeb;

TRANSFORM Sum(union.quan) AS quanOfSum
SELECT union.Mth
FROM [union]
GROUP BY union.Mth
PIVOT union.type;


TABLEJAN

id quan type
1 1 c
2 1 c
3 2 d
4 2 d

TABLEFEB

id quan type
1 2 e
2 2 e
3 3 d
4 3 d

How do i make a query with row total????help please

month SUM(e) SUM(d) SUM(c)
JAN 0 4 2
FEB 4 6 0
total * * *
 
G

Guest

Normally totals are generated in a form or report section. You could create a
totals query based on your crosstab and then union the first crosstab with
your totals based on your crosstab.
 
D

daniellchiu via AccessMonster.com

I found out the answer by using join 2 crosstab table
here is what i have got

SELECT "JAN" as Mth , id, quan, type
FROM tablejan
UNION ALL select "FEB", id, quan, type
from tablefeb;

TRANSFORM Sum(union.quan) AS quanOfSum
SELECT union.Mth
FROM [union]
GROUP BY union.Mth
PIVOT union.type;

TABLEJAN

id quan type
1 1 c
2 1 c
3 2 d
4 2 d

TABLEFEB

id quan type
1 2 e
2 2 e
3 3 d
4 3 d

How do i make a query with row total????help please

month SUM(e) SUM(d) SUM(c)
JAN 0 4 2
FEB 4 6 0
total * * *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

monthly quantity matching report 3
monthly quantity report 4
Excel Help with dates 2
UNION and Crosstab query 5
Crosstab guery from multitables 2
Calculate in a Crosstab? 4
cross tabg query 1
Link Query 3

Top