Date Format Convert using linq

Hi Team,

i have 45 Columns of data in that datatable have 6 date columns… i want convert the date format based on the columns name…

Getting Error :
Assign: String ‘13-04-2023’ was not recognized as a valid DateTime.Couldn’t store <13-04-2023> in Order Date Column. Expected type is DateTime.

Can you tell how convert the datetime using linq.

Thanks
Shyam

@Shyam_Pragash

try with modern excel activities

click on custom and pass your required dateformat

cheers

Hi @Shiva_Nikhil

U r Right… excel activities we can able to change it.

i am using huge data so that i want know linq query is best and fastest method to process the datas… After convert the date conversion all the data are inserted into sql server. all process are completed except this datetime conversion issue…

Thanks
Shyam

Hi,

The error shows datatype of the target column is DateTime. As DateTime type cannot have date format, it’s difficult to store it as “dd-MM-yyyy” style except changing datatype of the column to String etc.

Regards,

Hi @Yoichi

is there any possibility to convert it ?

Thanks
Shyam

Hi,

If data already exists in the data column, we cannot convert it to other data type.
So, it’s necessary the following step.

  1. Add new DataColum as String (or object)
  2. Convert each data to dd-MM-yyyy style, then put into the column.
  3. Delete the old column then rename new column to old’s one (if necessary)
  4. Change ordinal of new Column (if necessary)

Regards,