Cross Tab Help

From: kou vang <gqkou79_at_gmail.com>
Date: Fri, 11 Dec 2009 07:20:45 -0800 (PST)
Message-ID: <bf5006cc-d84f-486c-831e-399e94103088_at_j19g2000yqk.googlegroups.com>



I can get this query to put the dataset together, but would love to get it into a cross tab. I don't know how to work with multiple CASE statements to do this? I want the columns to be the CASE results: Aquatic C, Aquatic R, Other and the Value to be ATTAINMENT_Desc. I think I'm pretty close. Thanks.

SELECT
ASSESS.LAKE_AUID.LAKE_ID,
ADB.ASSESSMENT_UNITS.CYCLE,
ADB.ATTAINMENT_LUT.ATTAINMENT_DESC,
(CASE ADB.Use_Lut.USE_ID

 WHEN 523 THEN 'Aquatic Consumption'
 WHEN 552 THEN 'Aquatic Consumption'
 WHEN 555 THEN 'Aquatic Consumption'
 WHEN 565 THEN 'Aquatic Consumption'
 WHEN 553 THEN 'Aquatic Recreation'
 WHEN 556 THEN 'Aquatic Recreation'
 WHEN 566 THEN 'Aquatic Recreation'

 ELSE 'Other'
END) AS ATT_DESC Kou Received on Fri Dec 11 2009 - 09:20:45 CST

Original text of this message