Fixed handling of date filter inputs in SQL

Change-Id: I3b8d96e6bd3f07fbce25c1ed3cb3b33ba054b6fa