Data conversion Problem in Derived Column
I have a variable at the Package level MaxDate with string datatype in the expression of variable I am getting Max date from Time dimension
@Maxdate =select max(date) from dimtime
Now I am using this variable in derived column transformation like this
rmrsentout < (DT_DBTIMESTAMP)" 1899-12-31" || rmrsentout > (DT_DBTIMESTAMP)
@[User::Maxdate] ? (DT_DBTIMESTAMP)"1899-12-31" : rmrsentout
[Derived Column [10059]] Error: Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_DBTIMESTAMP.
but I have hardcoded a value like
rmrsentout < (DT_DBTIMESTAMP)" 1899-12-31" || rmrsentout > (DT_DBTIMESTAMP) "2200-12-31 "? (DT_DBTIMESTAMP)"1899-12-31" : rmrsentout
it works I dont understand why its giving error with the variable
arun
May 11th, 2011 11:26am
Hi Malhotra,
Which data type was used for the variable @[User::Maxdate]? Datetime worked for me.Happy to help! Thanks. Regards and good Wishes, Deepak.
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 1:00pm
String DataType
I Can't use datetime because I am giving expression select max(date) from dimtime
arun
May 11th, 2011 1:08pm
1) Oh sorry missed it out. Is the Evaluate as expression property for the variable set to "TRUE"?
2)If it is TRUE and not wokring, use the query in OLEDB source and further it can be handled in the transformation right?Happy to help! Thanks. Regards and good Wishes, Deepak.
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 1:15pm
Yes Evaluate as Expression property is True
I dont undertsand "use the Query in OLEDB source" ?arun
May 11th, 2011 1:18pm
Its TRUE and working but the problem is in Derived column when I am casting string variable to DT_DBTIMESTAMP
then its giving error.arun
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 1:21pm
What exactly does select max(date) from dimtime return when run in SSMS?
Talk to me now on
May 12th, 2011 3:15am
I thought this question was answered in your other post
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/1ae06f76-b86f-49fa-872e-54c5a89ac8b0/#e77b2413-ae66-4e4d-adaf-f46f7e07a6e6Jeff Wharton MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt) MCT, MCPD, MCITP, MCDBA, MCSD, MCAD
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2011 4:25am