I need help. I’m filtering a datatable, and now i must add a new condition to the filter.
I must capture in the table all records from last 6 days until today.
I tried to use this, but the output table has no lines, the original has 5000 lines.
Can anyone help please!
Kindly check the datatype of the column “DATA_CRIACAO”.
Maybe its string so it is unable to compare string with the date provided in value
as far we have understood if the record’s date 6 days old or newer then it should pass the filter, right?
it looks like Operation is filtering the opposite (regardless of maybe other datatype issues)
It’s the first date. Date of DB creation
I’ve tried to change the operation and has returned 0 lines treated.
so we are one step further:
the operation is as intended. Now maybe a datatype confusion blocks the current working filter.
So we do know what is on right side (datatype)
for quick checking what is on left side you can do following:
- place a breakpoint on the filter datatable activity
- debug an pause
- use on watch panel ollowing statement
- share the result of this with us (e.g. as screenshot)
Here it is…
please use this watch panel:
this was the result…
ideally it should look similar like this without evaluation issue:
as an alternate maybe you can share with us like this:
ensure that the breakpouint is set on a place where the datatble is already filled with data
the best and most direct analysis is to inspect the content of the datatable (visually displayed value in Excel is not a mandatory the same within the datatable. Thats the reason for our request)
as mentioned click on the pencil (of the corresponding DataTable) then we can see the content. Thanks
So datatable is empty / has no rows
Can be also crosschecked on e.g watch panel from above with statement YourDataTableVar.Rows.Count
So the condition is correct…
DateTime.Now.AddDays(-5), it should bring to me all data records between 14-01 and today, right?
Best point to rate the situation is once we do know the excatly content within the datatable.
Date/DateTime filter issues can come from:
- datatype missmatch, lexically ordering, format differences (just to name a few).
However there is a good course offerered on the Academy platform related to Debugging. It introduce a few concepts (you now had used e.g. inspecting the locals, watch panel…) It is highly recommended to have a look on this course as the demonstrated topics will help much for doing analysis on issues etc
Thanks, i will follow your advise.
I’m going to take a look at that course.
Could you please share course link to directly jump