Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2007-09-06 : 10:45:58
|
| I want to write expression on derived column in SSIS package likeIF Termdate <> "" THEN CDate(Termdate) ELSE NULLEND IF Can any one help for me?ThanksSanjeev |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-06 : 10:55:52
|
| CASE WHEN Termdate <> "" THEN CDate(Termdate) ELSE NULL ENDMadhivananFailing to plan is Planning to fail |
 |
|
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2007-09-06 : 11:13:10
|
| No I want to write this on expression box of derived column in data flow task (SSIS) not in SQL statements.ThanksSanjeev |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-09-06 : 11:58:24
|
One way to do it is: LEN(TRIM(Termdate)) > 0 ? (DT_FILETIME)Termdate : NULL(DT_FILETIME) You might want to look up the different types of Date/Time types to see which one makes sense. Here is a quick rundown from BOL:Data type Date format -------------------------------------------- DT_DBDATE yyyy-mm-ddDT_FILETIME yyyy-mm-dd hh:mm:ss:fffDT_DBTIME hh:mm:ssDT_DBTIMESTAMP yyyy-mm-dd hh:mm:ss:fffffffff |
 |
|
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2007-09-06 : 12:11:43
|
| Thanks a lot LampreySanjeev |
 |
|
|
|
|
|