graphene
graphene

Reputation: 157

Date column recognized as data type but it set as NULL to a specific format

To put in context check it out here: Need to import a DATE column in excel to a SQL table using SSIS

Another issue I found a few moments ago. If SSIS set one column of date as DATE datatype, dates like 19 Apr 2017 will disappear (will turn NULL in the original table)... but not those with 24/nov/16 format. This happens when we load the original table (before the staging table)... The case which never gives problems is when SSIS set the column of date as Unicode string [DT_WSTR] (255). This is driving me mad! How to overcome this new issue? Cannot change the original excel file, neither to force to change the datatype in SSIS for the date column (from DATE to Unicode String). Thanks! How to overcome this new issue?

EXCEL FILE

date 
 19 Apr 2017
 n/a 
 07/nov/13

WHAT we see in the original table

date
 NULL
 n/a
 2013-11-07

what it should appear:

date 
 19 Apr 2017 or something that shows this info (format does not matter)
 n/a
 2013-11-07

Upvotes: 0

Views: 542

Answers (1)

graphene
graphene

Reputation: 157

It seems that If I write a sql comand like select FORMAT([LoginDate],'YYYY-MM-DD') as F1 it works.

Upvotes: 1

Related Questions