I removed the function from the WHERE and replaced it with a local variable:
AND CD_DW_INSERT_DATE > @Date
I got another problem on a JOIN.
Found filtering columns wrapped inside User-Defined Function call.
AND PTD.Ptd_trans_process_date = CypressStaging.dbo.Fncconvertas400date(ExtCov.Last_change_date)
The function dbo.Fncconvertas400date converts AS400 Date format to SQL Server Date.
I do not know if and what I could do for this?
Thanks again.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/