Change the format for the entire column - Date format now - 10/17/2018 3:59:59 AM to 10/17/2018 WITHOUT LOOPING

I WANT TO CHANGE THE FORMAT OF ONE ENTIRE COLUMN IN EXCEL FROM 10/17/2018 3:59:59 AM WITH TIMESTAMP (CURRENTLY EXISTS) TO WITHOUT TIMESTAMP - 10/17/2018 .
BUT I WANT TO DO WITHOUT LOOPING

Possibly there can be custom built activities. But you can also do it just with opening the excel sheet on the excel desktop application and using the ui automation activities to mimic the steps that you do to change the format manually.

Hi
Hope this expression would help you in that
Yourdatatable = Yourdatatable.AsEnumerable().GroupBy(Function(a) a.Field(of string)(“yourcolumnname”).ToString.Substring(0,10) ).CopyToDatatable()

Cheers @kavinnatarajan

2 Likes


@Palaniyappan

Hello,

try with this expression
Yourdatatable = Yourdatatable.AsEnumerable().Where(Function(a) a.Field<string>(“yourcolumnname”).ToString.Substring(0,10) ).CopyToDatatable()

Regards,
Sunil

2 Likes

@sunilRdGlobal
@Palaniyappan

1 Like

Hello,

use below Convert list for your column.
Create dt_Filter variable as Collection list with string.

(From q In dtmaster.AsEnumerable() Select q.Field(Of String)(“PostEndDate”).Substring(0,10)).ToList()

Thanks,
Sunil.

You have almost done
use Field(of string) instead of Field
In the above expression with the image
Cheers @kavinnatarajan