I have a crosstab query having grouping in 3 levels and i need to summup and disply total ....
how can i go about it
i m pasting my query -
-
$sql = 'select `main_state`,`state_name`,`gender`,'
-
. ' sum(if(nature_of_injury = 10,1,0)) as N10,'
-
. ' sum(if(nature_of_injury = 15,1,0)) as N15,'
-
. ' sum(if(nature_of_injury = 20,1,0)) as N20,'
-
. ' sum(if(nature_of_injury = 25,1,0)) as N25,'
-
. ' sum(if(nature_of_injury = 30,1,0)) as N30,'
-
. ' sum(if(nature_of_injury = 35,1,0)) as N35,'
-
. ' sum(if(nature_of_injury = 40,1,0)) as N40,'
-
. ' sum(if(nature_of_injury = 45,1,0)) as N45,'
-
. ' sum(if(nature_of_injury = 50,1,0)) as N50,'
-
. ' sum(if(nature_of_injury = 55,1,0)) as N55,'
-
. ' sum(if(nature_of_injury = 60,1,0)) as N60,'
-
. ' sum(if(nature_of_injury = 65,1,0)) as N65,'
-
. ' sum(if(nature_of_injury = 70,1,0)) as N70,'
-
. ' sum(if(nature_of_injury = 75,1,0)) as N75 '
-
. ' from esicinjury group by main_state , state_name , gender ';
-
This query gives me total record for each gender in each state gropuped by main_state ....and nature of injury in a column heading .....
i want sum(male) , sum(female) of all states in main_state on top as soon as main state changes .....
can you help .........
0 1257 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Darleen |
last post by:
I am seeking conceptual here on how to get started with a "3D Matrix"
in Access. We run a training center which holds multiple classes in
multiple cities at multiple times. So I need to create a...
|
by: Steve Elliott |
last post by:
I have a query set up to gather together data between two specified dates.
Shown in the query column as:
Between #24/09/2004# And #01/10/2004#
Is it possible to enter several different date...
|
by: Sherman H. |
last post by:
I have a few questions for crosstab and popup form questions:
1. I created a crosstab as follows:
IT Financial Operation
John 21 22 ...
|
by: Paula |
last post by:
A query contains the fields CustomerID, CustomerName, OrderID and ItemID.
The query is based on a customers table, orders table, and order details
table. The orders table has a foreign key of...
|
by: Bryan |
last post by:
I've been looking over this newsgroup, but I can't find an answer to my
problem. I see that a few others have posted this issue over the
years, but none of them got a response. I'll give it...
|
by: newguy |
last post by:
I am trying to get the totals of a table by client by type of income.
This query will get what I am looking for with each unique combination
as a row:
SELECT Sales.Client, BillCode.Type,...
|
by: Penny |
last post by:
(Access 2003 Multiuser Split DB, Windows XP Pro)
Hi All,
I would really appreciate just some basic tips on how to make a Crosstab
Form based on a Crosstab Query. The query always has the same...
|
by: Mike |
last post by:
Hi everyone,
I found the Access reports too limited to do what i wanted so i created
a module to export a crosstab query to an excel file, and then i modify
it as i want. My problem is that i...
|
by: Peter Herath |
last post by:
I want to create a custormizable report . For an example, there's a form with four combo boxes and two of them having database tables columns/field names as values in the combo box(one for select row...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |