Datatables by date

datatable
studio
help

#1

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” ?


#2

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)

Regards,
Arivu


#3

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


#4

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

Year wise also???


#5

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


#6

Hi @marius_johansen,

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

Regards,
Arivu


#7

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.


#8

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.

Regards,
Arivu