Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:12:22+00:00 2026-06-13T23:12:22+00:00

In my SQL 2008 SSIS environment, I have data coming from a CSV file

  • 0

In my SQL 2008 SSIS environment, I have data coming from a CSV file and I need to fix up null dates.

Data from CSV looks like this:

01011990
01011990
01011990
01011990
01011990

In my staging table, I have a column defined as:

[SHIPPED DATE] date NOT NULL

First I fix the date values by pushing the column through a derived transformation that has:

(DT_DBDATE)(SUBSTRING([SHIPPED DATE],1,2) + “/” + SUBSTRING([SHIPPED DATE],3,2) + “/” + SUBSTRING([SHIPPED DATE],5,4))

The above transformations makes my string dates coming form CSV import into a date column in my SQL db.

The output of this is:

1990-01-01
1990-01-01
1990-01-01
1990-01-01
1990-01-01

Next, I’d like to deal with NULL dates so that I can stay true to the “NOT NULL” definition in my db. What I want to do is assign the NULL dates a default value but I get an error message as per below:

Error at CSV to SQL [Derived Column [24817]]: The data types “DT_WSTR” and “DT_DBDATE” are incompatible for the conditional operator. The operand types cannot be implicitly cast into compatible types for the conditional operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

My CSV column is WSTR, my destination in the SQL DB is a “date” column.

My transformation I am trying to use is:
ISNULL([SHIPPED_DATE]) ? “1900-01-01” : [SHIPPED_DATE]

It does not want to work due to the above message. Can anyone point me to the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:12:22+00:00Added an answer on June 13, 2026 at 11:12 pm

    Change your expression as shown below. You have two parts to the ternary operator.

    Part 2 you have it as [SHIPPED_DATE], which is of type DT_DBDATE because you are already casting this value in the derived column transformation.

    However, Part 1 is simply assigned as text "1900-01-01". You need to add (DT_DBDATE) before that string value to type cast it to date format so that both the values specified on the ternary operator are of same data type.

    From

     ISNULL([SHIPPED_DATE]) ? "1900-01-01" : [SHIPPED_DATE]
    

    To

     ISNULL([SHIPPED_DATE]) ? (DT_DBDATE)"1900-01-01" : [SHIPPED_DATE]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a [SQL 2008] SSIS package that takes a CSV text file and
I'm trying to copy data from MySQL to SQL Server 2008. My SSIS is
I have a SQL Server 2008 database which contains data that I need to
I have an SSIS 2008 package that reads data from an Access database (OLEDB
I am using SSIS (SQL Server 2008 R2) to transform an input CSV file
I have an SSIS package (SQL 2008) that I need to connecto to an
I have an SSIS package set up to export data from a SQL Server
I have a small SSIS package which exports data to a excel file from
I'm creating an SSIS 2008 package that reads data from an ASCII flat file
I have an Execute SQL task (SQL 2008) where I'm using two SSIS variables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.