I’m having some issues when trying to filter using dt.Select() method.
My sequence is like the following:
read csv activity create dt # retrieve data dateend = new datetime(now.year, now.month, now.day) # create end range date dateinit = datend.AddDays(-2) # create start range date dt = dt.Select( "[date] >= #"+ dateinit.ToString +"# AND [date] <= #" + dateend.ToString +"#").CopyToDataTable # filtering dt
When I run this script a runtime execution error occur that says “The Source contains no DataRows”
But my dt does contains the dates I’m filtering.
These datetimes are formatted mm/dd/yyyy hh:mm:ss in the original source.
If I change to a larger dateinit it does work.
I dont understand why it works in certain condition but not in others, can you guys help me out to spot the problem?