I have the following query
select pp.PatientProfileId AS MRN, DD.SDID, pp.Last AS LastName, pp.First AS FirstName,
CONVERT(varchar(10), pp.Birthdate, 101) AS DOB,
substring(DATA,patindex('%assessment/plan%',DATA),2000), dbo.Convert_ID_to_date(clinicaldate)
as ClincalDate
FROM
DOCDATA dd inner join DOCUMENT do on dd.SDID = do.SDID
inner join PatientProfile pp on do.PID = pp.PId
WHERE DATA LIKE '%assessment/plan%'
and pstatus = 'A'
and dbo.Convert_ID_to_date(clinicaldate) > '1/1/2012'
When I excute it, the DATA portion is not complete to the end of the informatio I see via the UI.
I have checked for mulitple linked rows and found none for my test.
What could I be missing?
Thanks.
John
Reach me at [email protected] and I will attempt to work through the problem with you.
DocData is separated into multiple rows, so you have to use COALESCE to bring them all together