Guest User

Untitled

a guest
Aug 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. select
  2. 'Historical Sprout Note' as Title
  3. ,p.EmrID as GreenwayId
  4. ,Stuff( (Select Concat(N2.Details, ' : ', u.FirstName, ' ', u.LastName, ' ', TRY_CONVERT(nvarchar(127), n2.[CreatedOn]))
  5. FROM Notes n2
  6. Join UserProfiles u on u.id = n1.CreatedBy
  7. For XML PATH('') , Type).value('.', 'varchar(max)'),1,1,'')
  8. From
  9. Notes as n1
  10. JOIN Patients as p ON
  11. p.Id = n1.PatientId
  12. Group by p.EmrID
Add Comment
Please, Sign In to add comment