Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Addressed for Version 2.05 » View Incident Report |
Serious |
Reported By: Michael Reisch Reported On: 6/14/2011 For: Version 2.05 Build 9 |
SELECT *, pt1.ProtocolDate, IF(COALESCE(a.CompanyName, '') = '', a.FullName, a.CompanyName) AS AddressText from ( SELECT pr1.GUID_ID, pr1.Report_ID, pr1.Protocol_GUID, pr1.Project_GUID, pr1.Place_GUID, pr1.Catalog_GUID, pr1.Catalog_Type, '' AS Catalog_GUID_Parent, CAST('' AS VARCHAR(200)) AS Description, pr1.Address_GUID, pr1.ContactName, pr1.Date_ToDoFrom, pr1.Date_ToDo, pr1.Date_Done, pr1.ObjType, pr1.State, pr1.ReportPriority, pr1.ReportInfo, CAST('' AS VARCHAR(500)) AS PlaceText, pr1.CreateDate, pr1.ModifyDate FROM "ProtocolReport" pr1 WHERE pr1."Protocol_GUID" = :aProtocol_GUID UNION SELECT pr2.GUID_ID, pr2.Report_ID, pr2.Protocol_GUID, pr2.Project_GUID, pr2.Place_GUID, pr2.Catalog_GUID, pr2.Catalog_Type, '' AS Catalog_GUID_Parent, '' AS Description, pr2.Address_GUID, pr2.ContactName, pr2.Date_ToDoFrom, pr2.Date_ToDo, pr2.Date_Done, pr2.ObjType, pr2.State, pr2.ReportPriority, pr2.ReportInfo, '' AS PlaceText, pr2.CreateDate, pr2.ModifyDate FROM ( select * from ( select * FROM ProtocolReport where Project_GUID = :aProject_GUID AND ObjType > 0 AND Protocol_GUID IN (SELECT ptOpen.GUID_ID FROM "Protocol" ptOpen WHERE Project_GUID = :aProject_GUID AND ptOpen.ProtocolDate < (SELECT ProtocolDate FROM "Protocol" WHERE GUID_ID = :aProtocol_GUID ) ) ) AS prOpen WHERE NOT GUID_ID IN ( select GUID_ID from ( select * FROM ProtocolReport where Project_GUID = :aProject_GUID AND ObjType <= 0 AND Protocol_GUID IN (SELECT ptClosed.GUID_ID FROM "Protocol" ptClosed WHERE Project_GUID = :aProject_GUID AND ptClosed.ProtocolDate < (SELECT ProtocolDate FROM "Protocol" WHERE GUID_ID = :aProtocol_GUID ) ) ) as prClosed ) GROUP BY GUID_ID ORDER BY GUID_ID, ModifyDate DESC ) as pr2 WHERE NOT pr2.GUID_ID IN (SELECT pr.GUID_ID FROM "ProtocolReport" pr WHERE pr.Protocol_GUID = :aProtocol_GUID) ) as ptrep LEFT OUTER JOIN "Protocol" pt1 ON (pt1.GUID_ID = ptrep.Protocol_GUID) LEFT OUTER JOIN "vw_AddressFullNames" a ON (a.GUID_ID = ptrep.Address_GUID) ORDER BY ptrep.CreateDate DESC, ptrep.Report_ID
This web page was last updated on Wednesday, October 30, 2024 at 11:41 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |