This project is read-only.

DateFilter Equals not working properly

Oct 26, 2015 at 7:59 AM
Edited Oct 26, 2015 at 8:00 AM
When i filter for date eg. in my database i have 16-06-2014 21:43:32(time) and 16-06-2014 09:45:12 .If the filter equals value is 16-06-14 , none of the above is displayed.

I want the above values to be selected from database.

Thanks in advance .
Jan 6, 2016 at 9:28 PM
You will need to double check the EXACT value in your DB (assuming what you provided) and EXACTLY how .NET is rendering each field from the Model when you are returning the View. In my own case, I had Oracle DATE fields storing only Date whereas .NET (which only has a DateTime DataType) kept throwing (ex.) 12-24-2015 12:00:00 AM since the Time value was expected.

In my case, I am using both the Grid Filters that are built-in, as well as an all-field Wildcard Search setup via some JavaScript calls to a Controller Action. For me, the DATE values in Oracle DB are (ex.) 12/24/2015, are handled in .NET Controller as (ex.) 12/24/2015 12:00:00 AM, and when I display them in my Grid I format them as only the Date:
columns.Add(o => o.ACQUIRED_DATE).Titled("Acq. Date").RenderValueAs(o => string.Format("{0:MM/dd/yyyy}", o.ACQUIRED_DATE)).SetWidth(20);
Then when I search (ex.) 12/24/2015, the grid displays only those values.

Hope it helps somehow. Start at the DB and work your way through each step of the process to see how the value EXACTLY is being given as it moves through from Point A to the grid itself rendering.
Jan 19, 2016 at 11:48 AM
Hi vigneshmv

as JScurlock told check exact value in DB and also check there is not space before date .

With Thanks

Jan 25, 2016 at 6:36 PM
I have the same problem. "Equals" is not working at all. I'm trying to set RenderValueAs according to my needs but nothing changes. When I choose 12/10/2015 for example, the table becomes empty.