Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS convert a zero to null

$
0
0

I have a .dat file that is being loaded in SSIS into an SQL table.  There are multiple fields that are specifically designated to be "datetime."  The source data file is for a COBOL system.  The COBOL system has "00/00/00" automatically entered into several of these fields so an end user can see the field is for a date.  Many of these date fields never have anything entered and remain "00/00/00."  In the .dat file, the "00/00/00" is interpreted to be a single zero.  Then, when the SSIS package tries to insert a zero into a date field, SQL interprets that zero to be "2000-01-01 00:00:00.000."  How can I use a derived column to make the single 0 a null before SQL interprets it to be 2000-01-01?  I've combed the web and cannot find a solution to this.  I know it is something like...REPLACE(db_catty_to_date) == 0 ISNULL ? do_nothing_to_field_and_accept_a_valid_date_that_it_contains.  Can ANYONE give me a solution to this?

MANY THANKS!!!



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>