Fixed handling of date filter inputs in SQL

Change-Id: Ia7d0567b673d9f4e478a81f2776a136b36a6676f