I don't really know how to achieve this using SQL Command using SAP driver but here are some useful infos
If you are working with DateTime Data Type , Datetime are not stored with their formats they are stored as Number OR string Values (The are many ways that date are stored (related to the data provider used); decimals or two integer , ...) .
For more info take a look at :
Date formats are related to your Regional , application , DBMS settings
If you want to show dates with other formats you have to change the related setting. Or you can convert it to String
datatype with a specific format using a script component:
If Dates are stored as string
If the Date column is a string you can use the DateTime.ParseExact
method in a script component. (assuming that outDate
is the output column and inDate
is the input column)
using System;
using System.Globalization;
CultureInfo provider = CultureInfo.InvariantCulture;
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.outDate = DateTime.ParseExact(Row.inDate,"dd.MM.yyyy HH:mm:ss",provider).ToString("yyyy-MM-dd");
}
for more info on this method you can refer to this links:
If dates are stored as dates
using System;
using System.Globalization;
CultureInfo provider = CultureInfo.InvariantCulture;
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.outDate = Row.inDate.ToString("yyyy-MM-dd");
}