After having spent too long developing an Access app, I need to move to SQL 2008. I have searched and read and I am still struggling. To get me on the right path, can someone covert this to a Stored Procedure that will run on SQL 2008 ?
I expect the code is far from neat, so appreciate any pointers. Thanks.
(Select iiF(Count(*)>0,TRUE,FALSE) From [Risks and Issues Attachments] Att Where Att.Parent = [R].ID) AS Attachment,
iif(Plans.System = True,Plans.Title,Plans.Title & ' [' & Plans.Start & ']') AS [Milestone Impacted],
R.[Due By] AS Deadline,
R.[Risk Level] AS [Issue Level],
FROM (Workstreams INNER JOIN Plans ON Workstreams.ID = Plans.WorkstreamID) INNER JOIN [Risks and Issues] AS R ON Plans.ID = R.PlanID
WHERE R.[RAID Type] = 'Issue' and [Project Reference] = [@PROJECT]
ORDER BY R.Status DESC , R.[Impact Score] DESC;