February 23, 2010 at 3:48 pm
I used Ltrim([enrichment_dt])== "1/1/1900" ? ""
does not work .
Can anybody please help ?thanks in advance.
February 23, 2010 at 3:50 pm
What is the desired datatype of the end-result? Also what is the datasource?
CEWII
February 23, 2010 at 3:53 pm
the end data type is smalldate , reading from text file.
thanks
February 23, 2010 at 3:56 pm
Space is not valid for that datatype. you could replace it with a NULL, or you could change the datatype to a character type. But space isn't going to insert into a table.
CEWII
February 24, 2010 at 2:01 pm
Replacing the space with a null did not work either
February 24, 2010 at 2:06 pm
Ok, why don't you explain the whole process then because this trying to fix the problem we can see with the microscope isn't working..
CEWII
February 24, 2010 at 2:41 pm
text file comes with default date 1/1/1900 . I tried in derived column before converting in to date as [column1] =="1/1/1900" ? Null or
[column1] =="1/1/1900" ? "" before data conversion to date,
tried after data conversion to date as
[column1] =="1/1/1900" ? (DT_date) Null
does not work , either way , accomplished by using update at the end of loading in transact_ SQl but that is not our standards.
Please advice.
February 24, 2010 at 8:26 pm
Why don't you try:
[column1] =="1/1/1900" ? [column1] : NULL(DT_DBTIMESTAMP)
CEWII
February 25, 2010 at 1:11 am
Elliott W (2/24/2010)
Why don't you try:[column1] =="1/1/1900" ? [column1] : NULL(DT_DBTIMESTAMP)
CEWII
You need to reverse the 2nd and 3rd operand.
Also, I assume that col1 is of datatype DT_STR or DT_WSTR, so you will have to do an extra cast:
col1 == "1/1/1900" ? NULL(DT_DBTIMESTAMP) : (DT_DBTIMESTAMP)col1
The output needs to be stored in a new column (of data type DT_DBTIMESTAMP.
February 25, 2010 at 7:31 am
I agree, the flip is necessary. Sorry, it was late.
CEWII
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy