BigChinoDon
MIS
Hi all,
I work in a hospital and have a database for deaths. The crosstab query (below) works fine, but I need to sort by fiscal month of the US federal fiscal year. October should be the first month through September, the last month. I've thought about creating a second table listing the months and their sort order (ex: OCT =1, NOV = 2, DEC = 3, etc...) but don't know how to get it to join.
Any thoughts on the best way to do this?
Thanks,
Don
TRANSFORM Count(Deaths.[Patient Name]) AS [CountOfPatient Name]
SELECT Format([Date of death],"mmm") AS [Month of Death]
FROM Deaths
WHERE (((Deaths.[Date of Death])>=#10/1/2009# And (Deaths.[Date of Death])<=#9/30/2010#))
GROUP BY Format([Date of death],"mmm")
PIVOT Deaths.Unit;
I work in a hospital and have a database for deaths. The crosstab query (below) works fine, but I need to sort by fiscal month of the US federal fiscal year. October should be the first month through September, the last month. I've thought about creating a second table listing the months and their sort order (ex: OCT =1, NOV = 2, DEC = 3, etc...) but don't know how to get it to join.
Any thoughts on the best way to do this?
Thanks,
Don
TRANSFORM Count(Deaths.[Patient Name]) AS [CountOfPatient Name]
SELECT Format([Date of death],"mmm") AS [Month of Death]
FROM Deaths
WHERE (((Deaths.[Date of Death])>=#10/1/2009# And (Deaths.[Date of Death])<=#9/30/2010#))
GROUP BY Format([Date of death],"mmm")
PIVOT Deaths.Unit;