SELECT a.id ,
a.caseid ,
a.mainuserid ,
a.petitionerid ,
a.fname ,
a.fdescription ,
a.complete ,
a.qid ,
c.Blobid ,
d.FirstNm ,
d.MiddleNm ,
d.LastNm ,
CASE WHEN p.UserType = 'employer' THEN p.MaidenNm
ELSE p.FirstNm + ' ' + p.MiddleNm + ' ' + p.LastNm
END AS pet_name ,
c.Blobdata
FROM dbo.Formscase a
LEFT JOIN Forms b ON a.fname = b.FormName
LEFT JOIN FormsBlb AS c ON c.Activityid = a.id
INNER JOIN Users AS d ON d.UserId = a.mainuserid
LEFT JOIN Users AS p ON p.UserId = a.petitionerid
WHERE a.firmid = 2
AND a.caseid = 11337
AND b.Qid IS NOT NULL
AND b.IsObsolete = 0
ORDER BY fname ASC;
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.