Hi,
I'm trying to build a custom SQL statement in Business Objects and thanks to the error message Webi generates can't tell if I'm making a school boy error with the SQL statement or trying to get Webi to do something it can't do here's my statement;
SELECT
Incident_Number ,
Fields_Changed,
dbo.fn_adjusted_date( HPD_HelpDesk_AuditLogSystem.Audit_Date),
Log
FROM
HPD_Help_Desk
JOIN HPD_HelpDesk_AuditLogSystem ON HPD_Help_Desk.Entry_ID = HPD_HelpDesk_AuditLogSystem.Original_Request_ID
JOIN
(SELECT HPD_Help_Desk.Incident_Number, min (dbo.fn_adjusted_date( HPD_HelpDesk_AuditLogSystem.Audit_Date)) AS Audit_Date
FROM HPD_Help_Desk
JOIN HPD_HelpDesk_AuditLogSystem ON HPD_Help_Desk.Entry_ID = HPD_HelpDesk_AuditLogSystem.Original_Request_ID
WHERE
Incident_Number = 'INC000001234567' and
Fields_Changed like '%Assigned Group%'
GROUP BY
Incident_Number) AS HPA ON HPD_Help_Desk.Incident_Number = HPA.Incident_Number AND dbo.fn_adjusted_date(HPD_HelpDesk_AuditLogSystem.Audit_Date) = HPA.Audit_Date
It works if I try and link the subquery on the just the Audit_Date, but not on the Incident. The sub query runs fine on its own.
Been looking at it so long I can't see the wood for the trees so sure its me missing something simple, thanks for any advice.
Cheers
Marc
I'm trying to build a custom SQL statement in Business Objects and thanks to the error message Webi generates can't tell if I'm making a school boy error with the SQL statement or trying to get Webi to do something it can't do here's my statement;
SELECT
Incident_Number ,
Fields_Changed,
dbo.fn_adjusted_date( HPD_HelpDesk_AuditLogSystem.Audit_Date),
Log
FROM
HPD_Help_Desk
JOIN HPD_HelpDesk_AuditLogSystem ON HPD_Help_Desk.Entry_ID = HPD_HelpDesk_AuditLogSystem.Original_Request_ID
JOIN
(SELECT HPD_Help_Desk.Incident_Number, min (dbo.fn_adjusted_date( HPD_HelpDesk_AuditLogSystem.Audit_Date)) AS Audit_Date
FROM HPD_Help_Desk
JOIN HPD_HelpDesk_AuditLogSystem ON HPD_Help_Desk.Entry_ID = HPD_HelpDesk_AuditLogSystem.Original_Request_ID
WHERE
Incident_Number = 'INC000001234567' and
Fields_Changed like '%Assigned Group%'
GROUP BY
Incident_Number) AS HPA ON HPD_Help_Desk.Incident_Number = HPA.Incident_Number AND dbo.fn_adjusted_date(HPD_HelpDesk_AuditLogSystem.Audit_Date) = HPA.Audit_Date
It works if I try and link the subquery on the just the Audit_Date, but not on the Incident. The sub query runs fine on its own.
Been looking at it so long I can't see the wood for the trees so sure its me missing something simple, thanks for any advice.
Cheers
Marc