Datatables by date



I have a big datatable from Excel that i want to sort into smaler datatables by month. but the date are all in format “dd/MM/yy”, how do i take this big datatable and put in in different tables by month when the colum date is “dd/MM/yy” ?


Hi @marius_johansen,

using this code we can sort .
(From p In dtDummy Order By DateTime.ParseExact(p.Item("datestring").ToString, "dd/MM/yy", System.Globalization.CultureInfo.InvariantCulture) Ascending Select p).CopyToDataTable

Refer this xaml file for sorting the date string from datatable.
sortDataTable.xaml (9.5 KB)



thanks, but how do i do this when i want to put data from January in a datatable or a Excel file for januar ?


Hi @marius_johansen,
Do you want to split each month in a different datatable from the main datatable???

Year wise also???


yes, that that is correct!
can you help me ?


Hi @marius_johansen,

ya sure.
Refer the below xaml file to how to get the each month data splitup.
sortDataTable.xaml (16.4 KB)



hi @arivu96
almost, i can’t post example program because i’m New to the forum, so i have to try to explain better.
i have example 100rows and 20 coulums in my DT.
the 100 rows is for one hole year.
i want to split these 100 rows into 12 DT’s by wich month it is and then put it back in 12 different Excel files.
one file each month With all the 20 coulums.


Hi @marius_johansen,

Yes you can get the 12 different datatable based on your input, only one thing you need to do you need write it into the excel file using write range activity.