Friday, March 30, 2012

Query Help

My data file looks like this:
Period, MCO, HMO, MeciareMem, MedicaidMem, CommMem, TotalMem
2Q02, Aetna Aetna Health of CT, 0, 0, 37947, 37947
2Q03, Aetna Aetna Health of CT, 0, 0, 41110, 41110
but I have thoustands of rows.
What does my query need to look like to get the following data set? I think
I need to use the CASE function?
Period MCO, 2Q02HMO, 2Q02MeciareMem, 2Q02MedicaidMem, 2Q02CommMem,
2Q02TotalMem, 2Q03HMO, 2Q03MeciareMem, 2Q03MedicaidMem, 2Q03CommMem,
2Q03TotalMem
Thanks in advance for the helpYou can't have Period in the output too,
Since on a single row will be data from both 2Q02 and 2Q03, if you eave out
the Period column then this is a "CrossTab" Query.. Do a search in this foru
m
for "Crosstab" There are many posts that describe how to go about it...
"William" wrote:

> My data file looks like this:
> Period, MCO, HMO, MeciareMem, MedicaidMem, CommMem, TotalMem
> 2Q02, Aetna Aetna Health of CT, 0, 0, 37947, 37947
> 2Q03, Aetna Aetna Health of CT, 0, 0, 41110, 41110
> but I have thoustands of rows.
> What does my query need to look like to get the following data set? I thi
nk
> I need to use the CASE function?
> Period MCO, 2Q02HMO, 2Q02MeciareMem, 2Q02MedicaidMem, 2Q02CommMem,
> 2Q02TotalMem, 2Q03HMO, 2Q03MeciareMem, 2Q03MedicaidMem, 2Q03CommMem,
> 2Q03TotalMem
> Thanks in advance for the help
>
>

No comments:

Post a Comment