# MySQL functions like now() in server side filters

**URL:** <https://community.dreamfactory.com/t/mysql-functions-like-now-in-server-side-filters/2744>\
**Category:** Users & Roles\
**Created:** [May 23, 2016, 4:12pm UTC](https://community.dreamfactory.com/t/mysql-functions-like-now-in-server-side-filters/2744 "2016-05-23T16:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bohndorf](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bohndorf](https://community.dreamfactory.com/u/bohndorf)\
**Post date:** [May 23, 2016, 4:12pm UTC](https://community.dreamfactory.com/t/mysql-functions-like-now-in-server-side-filters/2744/1 "2016-05-23T16:12:48Z")

</div>

How can I create a server side filter for the following SQL expression in a role?:  
(startdate=0) or (startdate \<= now())

Trying using a MySQL function as filter value always results in an error “Field ‘starttime’ must be a valid integer.”.  
Also I don’t know how to use nested filter conditions.

Related to DreamFactory 2.1.2 (self hosted linux)

---

<div class="post-metadata">

**Author:** ![bohndorf](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bohndorf](https://community.dreamfactory.com/u/bohndorf)\
**Post date:** [May 24, 2016, 9:05am UTC](https://community.dreamfactory.com/t/mysql-functions-like-now-in-server-side-filters/2744/2 "2016-05-24T09:05:38Z")

</div>

I solved it now: You have to add parenthesis around the MySQL functions AND you have to separate the parenthesis with spaces!

A working example for a nested filter:

Field: "( starttime"  
Operator: "\<="  
Value: “( UNIX\_TIMESTAMP() ) ) OR ( starttime = 0 )”

---

<div class="post-metadata">

**Author:** ![DFCommunityManager](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/dfcommunitymanager/32/887_2.png) [@DFCommunityManager](https://community.dreamfactory.com/u/DFCommunityManager)\
**Post date:** [June 1, 2016, 8:42pm UTC](https://community.dreamfactory.com/t/mysql-functions-like-now-in-server-side-filters/2744/3 "2016-06-01T20:42:50Z")

</div>

Hello @bohndorf, we’re so glad to see that you solved it! Thanks also for posting the answer.

Thanks,  
@AlexBowen
