I have used add data row to copy date values and paste in other datatable using (Cdate(row(“Date”).toString).ToString(“dd/MM/yyyy”)) as I need the date in dd/MM/yyyy format.
The format in output excel shows as General.
I tried using assign activity :- dt.columns(“new_date”).datatype= GetType(DateTime) and used sort datatable activity to sort on basis of “new_date” column. But sorting is not working and datatype is not getting changed to Date format
I have one datatable, dt1
i have used build datatable and built dt2
i copied data from dt1 to dt2 using add data row in for each. When i did this, i see the column having Date is in general format and not date
i have to sort that date column
so i tried
2- sort datatable
But output is not coming as the complete column is in general format
That’s string, not datetime. Datetimes do not have formats. If you have a datetime column and want to convert it to string in the format dd/MM/yyyy, then create a new column with datatype string, For Each Row in Datatable, and Assign the new column’s value to CurrentRow(“OldCol”).ToString(“dd/MM/yyyy”)