Roman F
asked on
Please modify my exisitng query
I have a simple table tblMain
Title Count
Status One 2
Status Two 3
Status Three 1
so to get the select statement :) you go
select * from tblMain
i want to modify the query and include the grandtotal also , so the results should be :
Title Count
Status One 2
Status Two 3
Status Three 1
Total 6
it is simple to use two queries and then combine using union query
I need it as one query
Title Count
Status One 2
Status Two 3
Status Three 1
so to get the select statement :) you go
select * from tblMain
i want to modify the query and include the grandtotal also , so the results should be :
Title Count
Status One 2
Status Two 3
Status Three 1
Total 6
it is simple to use two queries and then combine using union query
I need it as one query
ASKER
i did not get, no, i do not want that
what if i have fifty different statuses, ?
what if i have fifty different statuses, ?
try this
select title,[count] from tblMain
union
select 'Total' as title, sum([count]) from tblMain
select title,[count] from tblMain
union
select 'Total' as title, sum([count]) from tblMain
ASKER
That is what i was thinking, you use two queries and union them, I did that...
It is working...
is there just one select query?
It is working...
is there just one select query?
You cannot get there from here. - ie. without using a union query ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is this what you want?
OM Gang