WITH CTE AS ( SELECT
CONVERT(date, CONVERT(VARCHAR,CURRENT_TIMESTAMP,23), 111) as data_date,
FROM [db_bis].[staging].[stg_iwmf_xls_ecn_log_epc1] WITH (NOLOCK)
),
CTE2 AS
( SELECT
*,
CASE
WHEN [client_approved_or_rejected] IS NOT NULL and [client_approved_or_rejected] IN ('In Discussion', 'Submitted') THEN datediff(day, [date_raised],data_date)
ELSE NULL
END as days_outstanding
FROM
CTE)
When I run this query in the SSIS sql command window, it gives me the error.
TITLE: Microsoft Visual Studio
Exception from HRESULT: 0xC0202009
Error at DFT - Insert into stg_iwmf_summary_ecn_log_epc1 [OLE_SRC - Get data from stg_iwmf_xls_ecn_log_epc1 [78]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Statement(s) could not be prepared.".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Incorrect syntax near ')'.".
what could be wrong? Any help