[Accessd] export to excel

Stuart McLachlan stuart at lexacorp.com.pg
Wed Feb 19 16:20:01 CST 2003


If it's only A or B:

SELECT tblCounts.Patient, Sum(IIf([Cell]="A",[Count],0)) AS CellA, 
Sum(IIf([Cell]="B",[Count],0)) AS CellB, Sum(tblCounts.Count) AS Total, [CellA]/[Total] 
AS PercentA, [CellB]/[Total] AS Percentb
FROM tblCounts
GROUP BY tblCounts.Patient;

As long as there are not too many Cell types, you can extend this simply.



> Hello Gustav,
> 
> here is the structure of the table
> 
> Patient   Cell    Count
> 001        A        15
> 001        A        10
> 001        B        20
> 002        A        5
> 002        A        10
> 002        A        5
> 002        B        10
> 002        B        20
> etc. etc.
> 
> i need cross table
> 
>           CellA         CellB      
> patient   sum (%)       sum (%)         Total (%)
> 001       25  (55,5%)   20  (44,5%)     45    (100%)
> 002       20  (40%)     30  (60%)       50    (100%)
> etc.
> 
> only the percentage will do!
> 
> Pedro Janssen
> 
> 
> 
> 
> From: Gustav Brock <gustav at cactus.dk>
> To: "pedro at plex.nl" <accessd at databaseadvisors.com>
> Date: Wed, 19 Feb 2003 12:41:06 +0100
> Subject: Re: [AccessD] export to excel
> 
> Hi Pedro
> 
> I think you need to tell a bit more to get useful help.
> 
> Are you making one pivot table from data from 40000 patients?
> You can in Excel attach the data from Access without importing them.
> 
> Or is it one pivot for each patient?
> Do you need a graph or the only the data?
> Could you make a sketch of the requested output?
> 
> /gustav
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.






More information about the AccessD mailing list