How to dynamically set min and max values for date according to id?

Is there any way to set min and max values for date type using functions. For example, I need min value for date to be 2017-01-01 if id < 20. Else it should be 2018-01-01.

You’ve probably figured this out but, just in case you haven’t…

Set the date format to yyyy-mm-dd and add the code ‘if id <= 20 then “2017-01-01” else “2018-01-01” end’ with the ‘fx’ button.

Hope this helps.

Regards