# FilterValue against a date field

**URL:** <https://forum.radzen.com/t/filtervalue-against-a-date-field/5993>\
**Category:** Angular\
**Created:** [December 11, 2020, 3:08pm UTC](https://forum.radzen.com/t/filtervalue-against-a-date-field/5993 "2020-12-11T15:08:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![markb](https://forum.radzen.com/letter_avatar_proxy/v4/letter/m/a8b319/32.png) [@markb](https://forum.radzen.com/u/markb)\
**Post date:** [December 11, 2020, 3:08pm UTC](https://forum.radzen.com/t/filtervalue-against-a-date-field/5993/1 "2020-12-11T15:08:20Z")

</div>

I have a DataGrid and one of the column within which is a date field. I'd like to set a filter on the column to only return the records which have today's date in this column when the page is first opened.

It appears that I should be using the "FilterValue" property on the column but, I am struggling to get this to work. I've tried binding this property to a page variable or (for a test) just entering the today's date into the FilterValue property field wrapped in single quotes but, with no joy. I either see the date in data grid's filter field at runtime and get no data back or, the page won't compile.

I presume I'm not setting this property correctly to do what I want so, can you give me some pointers? I've got the column setup as follows:

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/b9093fd3fbeef697ec6449d56516e13bb1e3e462.png)

I've defined InitialDateFilter in the page Load handler and tried giving is various values such as 'EQ 12/11/2020', '12/11/2020' and ${new Date().toDateString()} all without success

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 11, 2020, 3:34pm UTC](https://forum.radzen.com/t/filtervalue-against-a-date-field/5993/2 "2020-12-11T15:34:58Z")

</div>

Hi @markb,

Please check this article on how to provide default filter:  
[https://www.radzen.com/documentation/default-column-filter/](https://www.radzen.com/documentation/default-column-filter/)

---

<div class="post-metadata">

**Author:** ![markb](https://forum.radzen.com/letter_avatar_proxy/v4/letter/m/a8b319/32.png) [@markb](https://forum.radzen.com/u/markb)\
**Post date:** [December 14, 2020, 2:30pm UTC](https://forum.radzen.com/t/filtervalue-against-a-date-field/5993/3 "2020-12-14T14:30:05Z")

</div>

Hi @enchev

Thanks for that and I've got this working perfectly up to a point. If I test it on a field which is a string or a number, I can get the initial filtering to work per the link you provided and if I set the columns FilterValue to the defaultOrderID property, it displays the value within the datagrid's filter selection row which is perfect.

However, if I try to use a date field, I get an error in Chrome:

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/bf8330104d95eaf3e35b85086fcb5d407c34a2d6.png)

Is there anything different that I should be doing for a date field? The filtering works fine but, getting the filtered value to show in the datagrid's filter selection row seems to be the sticking point?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 14, 2020, 2:33pm UTC](https://forum.radzen.com/t/filtervalue-against-a-date-field/5993/4 "2020-12-14T14:33:00Z")

</div>

According to the error error the value is most probably string not JavaScript Date object
