bethamsetty
asked on
How to convert flat file date ("041304") into sql Server date format in DTS
Hi ,
My client is sending one flat file which will be having one column called date field but in that date is coming like "041304". But through DTS i want to send it to my SQL Server table like this "13-Apr-2004". How to translate this ?
Do you think putting ActiveX script in middle and implement below logic is suggestable ?
Dim str
str = DTSSource("myDate") ' 041304
str = Mid(str, 1, 2) & "-" & Mid(str, 3, 2) & "-" & Mid(str, 5, 2) '04-13-04
DTSDestination("myDate")=c date(str)
Please suggest me good solution in this
Regards
Sridhar.B
My client is sending one flat file which will be having one column called date field but in that date is coming like "041304". But through DTS i want to send it to my SQL Server table like this "13-Apr-2004". How to translate this ?
Do you think putting ActiveX script in middle and implement below logic is suggestable ?
Dim str
str = DTSSource("myDate") ' 041304
str = Mid(str, 1, 2) & "-" & Mid(str, 3, 2) & "-" & Mid(str, 5, 2) '04-13-04
DTSDestination("myDate")=c
Please suggest me good solution in this
Regards
Sridhar.B
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
update the column in the temporary table as
update temptable set flatfiledatecolumns = substring(flatfiledatecolu