Re: Grouping by Years in Columns
From: Duane Hookom (duanehookom_at_NoSpamHotmail.com)
Date: 08/03/04
- Next message: Robert Humiston: "Re: Error in export of report"
- Previous message: Rick Brandt: "Re: RTF Export truncation"
- In reply to: Paige: "Grouping by Years in Columns"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 3 Aug 2004 15:13:44 -0500
You would first need to normalize your table by using a union query:
SELECT Hospital, Year, Indicator1 As TheValue, 1 as Indicator
FROM tblSpreadsheet
UNION ALL
SELECT Hospital, Year, Indicator2 , 2
FROM tblSpreadsheet
UNION ALL
SELECT Hospital, Year, Indicator3 , 3
FROM tblSpreadsheet
UNION ALL
...etc...
You can then create a crosstab based on the union query that sets the column
heading to
ColHead:"Year" & [Year]
Row Heading:
Hospital
Value
TheValue (first or sum or average or count or whatever)
-- Duane Hookom MS Access MVP -- "Paige" <pclements@kyha.com> wrote in message news:bb0501c47993$97bfa850$a401280a@phx.gbl... > I have a database set up like this: > > Hospital, year, indicator1, indicator2, indicator3, > > I want to see a report like this: > Year1 Year2 Year3 > Hospital > Indicator 1 > Indicator 2 > Indicator 3 > > > It looks simple but I am having a brain blockage on > this. Do I need to define my table differently or my > query? > > Help! >
- Next message: Robert Humiston: "Re: Error in export of report"
- Previous message: Rick Brandt: "Re: RTF Export truncation"
- In reply to: Paige: "Grouping by Years in Columns"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|