Link to home
Start Free TrialLog in
Avatar of Frank Bryant
Frank BryantFlag for United States of America

asked on

Determine the Date Format Style and/or Type

I have encountered an interesting situation; the text dumps being received lately have mixed date format styles/types in it; i.e. Column E Date Format is "22991231" (YYYYMMDD) and the Column S Date Format is "12/31/2299" (MM/DD/YYYY).

The YYYYMMDD format is what is expected for all date columns, as the Date Validation process runs the following code ...

CONVERT(VARCHAR,CONVERT(DATE,[TheColumnEDate],105),101)

... and the date data YYYYMMDD is converted to MM/DD/YYYY.

However the Date Validation Process Fails (Conversion failed when converting date and/or time from character string.) when the Column S Data is encountered.

Is there a way to identify the Date Format Style/Type and skip the specific date columns that do not need to be converted?
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frank Bryant

ASKER

jimhorn,

Thanks, and you confirmed my "assumption"; unfortunately I am in the position to use "as-is".
Good luck.  

I always use the line when estimating ETL projects, 'The more guarantees you can make about the data source, the lower my estimates are'.