473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

need row total and column total

name jan feb
a 20 10
b 30 20
c 40 30
i have this data and i need this as
name jan feb total
a 20 10 30
b 30 20 50
c 40 30 70
total 90 60 150
Aug 31 '13 #1
1 1437
Luuk
1,047 Expert 1GB
so you have:
Expand|Select|Wrap|Line Numbers
  1. select name, jan, feb
  2. from table
  3.  
and you want:
Expand|Select|Wrap|Line Numbers
  1. select name, jan, feb, jan+feb as total
  2. from table 
  3. union
  4. select 'total', sum(jan), sum(feb), sum(jan+feb)
  5. from table 
  6.  
(above is tested... ;)
Aug 31 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Terry | last post by:
All I'm doing, is using the Compute Method and getting the Sum of the Amount field in my SQL Query. The problem is getting the Data Table to add a Column and put the total in the "Total Column". I...
5
by: perspolis | last post by:
hi everyone I used a column expression like "UnitPrice*Quantity" for a cloumn named Total. but when I want to update my dataset by SqlDataAdopter, it gives me error. The column Total is just for...
0
by: Terry Olsen | last post by:
Is there a way to get the total column count in a DataGrid? I can get the total _visible_ columns, but I need to know how many _total_ columns are in my grid. Thanks!
1
by: pmarisole | last post by:
I need help in calculating a score from a row of drop-down values. I need to use the onChange to tally the score as the user moves across 9 categories (with drop-down selection of 1-9 or N/A)...
1
by: Byomokesh | last post by:
Hi I am trying to cell count and match in tgroup cols value in XML file. if cell count and tgrou cols value is mismatch, its showing error. My xml -------------- <tgroup cols="3"> <colspec...
3
by: mukesh | last post by:
I have designed a form in ms access to show the account of firms. In the total column i need a progressive total of one or more column of this form. what to do please thanks in advance
1
by: Piripiccio | last post by:
hello , i have a little question. In my xml i have a node called os . the possible values of this node are "Windows 9x" or "Linux" or something . I don't know how calculate how many Linux or...
4
by: drago | last post by:
Hi guys, I will be quick this time... Just want to know how we can calculate generic values in the same column. I am using invoice form with a services subform . I have a column of 'total' in subform...
1
by: erics44 | last post by:
Hi I have a Matrix in a report and i want the total column to sum a different field that is in the column group, is there any way of doing this? here is an example of my matrix ...
5
by: mrkh | last post by:
Hi all, I've created a table and it works just fine when you insert values in the text field. When you insert "0" as a value it still works, problem is if you skip a text field and don't insert...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.