Help: Change column Datatype

datatable

#1

How do I change column datatype after its been created or cloned.

For example, I cloned a datatable (no data). But want to change a column datatype from string to datetime.

How to replicate the following in uipath: ClonedTable.Columns[“Post. Date”].DataType = typeof(DateTime);

Thanks


#2

Hello @Daemo

Hope this help :slight_smile:

ClonedTable.Columns["Post. Date"].DataType = GetType(System.DateTime)

Regards


#3

Please refer attached code.

dtClone.xaml (8.8 KB)


#4

Hi @tomek.pawlicki
Can we do without cloning the datatable.
My requirement is there is one date value in one column… i want to compare that value with current date. But that column value is not datetime datatype. Can you please help me with That.
Thanks
Anantha


#5

Hi vvaidya,

I have a date column in excel in that i have date values i am not sure what type of datatype value is stored under date column and i want to convert all the date value into string datatype forma being the same. My date format is dd-mm-yyyy