0

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:

enter image description here

1
  • The screenshot looks like the data viewer. If the pipeline's column is set to data time (i.e., DB_TIMESTAMP) then the date time will should no matter what. You should be able to output that value to a DATE column on SQL Server, which will have the time removed if it is all zeros. Commented Jul 19, 2018 at 14:19

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.