Skip to Content
0
Former Member
Jun 30, 2010 at 06:40 PM

Sql command with union clause

12 Views

Hello here is my statement:

SELECT Global_Code.name as Descrip, Patient.patient_id, Global_Code.category

FROM Global_Code INNER JOIN

Patient ON Global_Code.code = Patient.race

WHERE (Global_Code.category = 'R')

union all

SELECT Global_Code.name, Patient.patient_id, Global_Code.category

FROM Global_Code INNER JOIN

Patient ON Global_Code.code = Patient.marital_status

WHERE (Global_Code.category = 'MS')

union all

SELECT Global_Code.name, Patient.patient_id, Global_Code.category

FROM Global_Code INNER JOIN

Patient ON Global_Code.code = Patient.living_arrangement_1

WHERE (Global_Code.category = 'LA')

I am trying to add these fields to a report. Example Race, Marital Status by using their description instead of just S for single and so on. The report just runs then stops responding. Can anyone help me with this?