After I run my select statement I get the following values "see image"
I would like to have a case statement to check if BloodPressureSystolic == 0 and if so, then pull the values from BPSRSit and BPSRSit and add then add the values to the temp table like this "115/65" can someone show me how to write a case like that.
Here is my select statement that I would like to add a case statement to
SELECT ad.ApptDate ,
ISNULL(v.Temperature, 0) AS Temperature ,
ISNULL(v.PS, 0) AS PerfStatus ,
v.*
FROM vitals v ,
AppointmentData ad
WHERE v.PatientId = 11
AND ad.ApptId = v.ScheduleId
AND ad.ApptDate < GETDATE()
AND ad.StatusId NOT IN ( 3, 8 )