Reputation: 31
I am currently working on a Transformation component script. I want to format the input date columns to "MMddYYYY".
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
/*
* Add your code here
*/
Row.SampleDate = Convert.ToDateTime(Row.SampleDate.ToString("MM/dd/yyyy"));
Row.TestDate = Convert.ToDateTime(Row.TestDate.ToString("MM/dd/yyyy"));
Row.ComponentsTestDate = Convert.ToDateTime(Row.ComponentsTestDate.ToString("MM/dd/yyyy"));
}
I am still getting a timestamp value once the scripts executes:
Upvotes: 0
Views: 550
Reputation: 31785
Strings have formats. DateTimes do not.
If you want to see your output in a specific format, you need your output column to be a string datatype.
Upvotes: 1