I have 2 tables: a claim table and a corresponding date table. There can be multiple dates for each claim, with a qualifier type to distinguish them, and I'd like to retrieve them all in one row. Here's a snippet of what I have:
SELECT
d.PointerField
, a.ApplianceDate
b.AccidentDate
FROM
( select case when isdate(CLM_StartDate) = 1 then CLM_StartDate else '' end as ApplianceDate, Pointer from claimdetailsDates where Pointer= 2645 and clm_dateQualifier = '439') as a
cross join
( select case when isdate(CLM_StartDate) = 1 then CLM_StartDate else '' end as AccidentDate, Pointer from claimdetailsDates where Pointer= 2645 and clm_dateQualifier = '433') as b
INNER JOIN
TableD as d
-- on a.pointer = d.Pointer and b.Pointer = d.Pointer
where d.ID = 2645
I know I have a few things wrong..but I can't seem to figure it out!
Thanks!
SELECT
d.PointerField
, a.ApplianceDate
b.AccidentDate
FROM
( select case when isdate(CLM_StartDate) = 1 then CLM_StartDate else '' end as ApplianceDate, Pointer from claimdetailsDates where Pointer= 2645 and clm_dateQualifier = '439') as a
cross join
( select case when isdate(CLM_StartDate) = 1 then CLM_StartDate else '' end as AccidentDate, Pointer from claimdetailsDates where Pointer= 2645 and clm_dateQualifier = '433') as b
INNER JOIN
TableD as d
-- on a.pointer = d.Pointer and b.Pointer = d.Pointer
where d.ID = 2645
I know I have a few things wrong..but I can't seem to figure it out!
Thanks!