Showing posts with label properly. Show all posts
Showing posts with label properly. Show all posts

Wednesday, March 7, 2012

Looking for the equivalence (date issue)

Hi all of you,

1)Ok, this works properly:

ISNULL([Column 13]) ? NULL(DT_WSTR,1) : RIGHT([Column 13],2) + "/" + SUBSTRING([Column 13],5,2) + "/" + SUBSTRING([Column 13],1,4)

for (old dts2000 column transformation)

Fecha=right(DTSSource("Col014"),2) & "-" & Mid(DTSSource("Col014"),5,2) & "-" & left(DTSSource("Col014"),4)
If IsNull(Fecha) then
DTSDestination("FechaAp") = Fecha
Else
DTSDestination("FechaAp")=null
End If

2). But how must I do such thing for IsDate when you have not available that function?

?

Fecha=right(DTSSource("Col014"),2) & "-" & Mid(DTSSource("Col014"),5,2) & "-" & left(DTSSource("Col014"),4)
If IsDate(Fecha) then
DTSDestination("FechaAp") = Fecha
Else
DTSDestination("FechaAp")=null
End If

Thanks a lot,

I think you'll need to use a script component to do this check. You can use the DateTime.TryParse method.

|||Thanks for that. It'll be tested.