How to Select data range between specific dates in datatable?

I get excel every month and it contains every datetime. But I have to filter it for current month. I use this code : in_dt_Excel.Select( “[Column3] >= #”+ str_FirstDate+“# AND [Column3] <= #”+ str_LastDate+“#”).CopyToDataTable

str_FirstDate: new DateTime( DateTime.Now.Year, DateTime.Now.Month, 1).Date.ToString(“yyyy-MM-dd”)

str_LastDate: new DateTime( DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(+1).AddDays(-1).ToString(“yyyy-MM-dd”)

but I get a error. " Assign: The source contains no DataRows."

How can i fix it?

Here is my example excel and I use transdate column :
image

@ozgecatak

Can you check the format you are getting into datatable?

There are cases we see in Excel a different format but while capturing the data to datatable the format might change

Place a breakpoint after the Read Range activity and debug, So, Once it read and pause you can able to see the value of datatable in Locals

Hope this may help you

Thanks,
Srini

This looks like this argument passed doesn’t have a value in it
Expression looks fine
Would recommend to check once the argument, direction of that argument and better to run in debug mode so that we can see LOCALS panel whether data is passed to that argument or not

Cheers @ozgecatak

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.