I'm pulling raw files from DB2 into SQL Server 2008 R2. I'm staging a report with a simple table, but want to convert the text yyyymmdd fields to actual dates in SQL Server.
This works just fine - except when I hit a NULL or blank - I'm looking for easiest way to either use an IF or ISNULL or CASE - I've read a ton of options that all dance around what I'm trying to do.
This file will run every 2 hours...
SQL
SELECTCONVERT(DATETIME,CONVERT(VARCHAR(8),ECL.LUDTE2))AS"Est Date"INTOdbo.DAILYREPORTFROMdbo.ECLECL