I have a question, it is related to our legacy system.
What I’m trying to do is to convert a field to a date format. Here is an
example:
len = 5
i.e.
71897 >>> 7/18/1997
len = 6
i.e.
120997 >>> 12/09/1997
len = 7
i.e.
1051711 >>> 05/17/2011
I’ve tried using expression’s if-then-else statement but I can only
validate 2.
Thanks
1 comment
-
Support Hello Dennis,
You have multiple ways of doing this.
1) if your source is a fixed length or delimited file, make sure the type of field is selected as 'Date'. You can then select a format from the format combo box. If the format you have does not exist in the combo, you can create a new one. In your case, the format would be YYMMDD. You can create any date format using these characters. We follow Microsoft standard for date and time formats. Here is a link.
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
2) There is also a ParseDate built in function. You can drag and drop that function on the dataflow and specify multiple formats and string input. the output will be a date field.
Once you have a date field, you can format it in the destination file by selecting the desired output format. You can also use ToString built-in function and specify a date format.
Thanks