Hi ,
How i can filter dt to get the date between 1-MM and 5-MM in current month ?
i am using filter to get the date in current month but i am not able to get only date between 1 to 5.
could anyone help me please
Thank you
Hi ,
i am using filter to get the date in current month but i am not able to get only date between 1 to 5.
could anyone help me please
Thank you
Hi,
In filter condition keep that dates detween 1 to 5 by using conditon from date =1-MM or date =2-MM and etc…
there is no way to create range between 1 to 5 ?
you can try by using linq query
can you please provide the query ?
can you please provide your excel ?
Sure
Hi,
Can you try the following expression?
dt = dt.AsEnumerable.Where(Function(r) DateTime.Parse(r("DateColumn").ToString)>=new DateTime(Now.Year,Now.Month,1) AndAlso DateTime.Parse(r("DateColumn").ToString)<new DateTime(Now.Year,Now.Month,6)).CopyToDataTable
Regards,
sorry , when there is no matching date i get this error
Hi,
Can you try as the following?
arrDr =dt.AsEnumerable.Where(Function(r) DateTime.Parse(r("DateColumn").ToString)>=new DateTime(Now.Year,Now.Month,1) AndAlso DateTime.Parse(r("DateColumn").ToString)<new DateTime(Now.Year,Now.Month,6)).ToArray
Note: arrDr is DataRow Array type.
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.