----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: Indiagenious Message 2 in Discussion Hi, I think following query will work fine: SELECT a.AgeCategoryTB, b.paAgeUnitID, CASE WHEN b.paGenderID = 1 THEN COUNT(b.paAgeUnitID) END AS Male, CASE WHEN b.paGenderID = 2 THEN COUNT(b.paAgeUnitID) END AS Female, CASE WHEN b.paGenderID = 3 THEN COUNT(b.paAgeUnitID) END AS Unknown, FROM Category a LEFT OUTER JOIN Patient b ON a.paAgeUnitID = b.paAgeUnitID GROUP BY a.paAgeUnitID, a.AgeCategoryTB If you can send me tables with data, I can definitely send you exact query. My email id is [EMAIL PROTECTED] ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
