Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All,

I need a solution for the following:

I have a field with datatype decimal, length 7, in the form yyyymmdd (f.e. 2007060).

Now I need to transfer this field into a field with datatype dt_DBDATE or DT_DBDATE.

I want requiring solution using a Script component in SSIS and i want C# code which is write in Script.

Any hint for me!!!

Thanks in Advance
Posted

1 solution

C#
privae DateTime convertDate()

       {
           string inputDate = "20140214";
           DateTime outputDate = Convert.ToDateTime(inputDate.Substring(4, 2) + "/" + inputDate.Substring(5, 2) + "/" + inputDate.Substring(0, 4));
           return outputDate;

       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900