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” ?
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 ?
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 ?
Refer the below xaml file to how to get the each month data splitup.
sortDataTable.xaml (16.4 KB)
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.