SELECT ID , RequestNumber , cat_id , CASE WHEN bo_priority IS NULL THEN '99999' WHEN bo_priority = '0' THEN '99999' else bo_priority END as bonpri ,bo_priority , Description , requestorID , programmerID , DeadlineDate , ProjectedDate , purpose , ((SELECT location FROM dbo.tblDefaultLocation WHERE tblDefaultLocation.locationid = tblRequestInfo.location) + '-' + (SELECT Status FROM dbo.tblDefaultStatus WHERE tblDefaultStatus.StatusID = tblRequestInfo.statusid)) AS statusid FROM tblRequestInfo INNER JOIN tblDefaultApprovalStatus ON tblDefaultApprovalStatus.ApprovalID = tblRequestInfo.managerApprovalID WHERE cat_id = 4 AND tblDefaultApprovalStatus.ApprovalID = 2 AND (programmerid is null OR programmerid < 1) AND (location <> 8 AND location <> 9 AND location <> 10) AND statusid <> 3 ORDER BY bonpri
Last Updated on October 26, 2015