Forum: Building VoltDB Applications

Post: Workaround for queries that would use CURRENT_DATE for SQL queries

Workaround for queries that would use CURRENT_DATE for SQL queries
benban
Oct 4, 2012
I recently built a Volt application using primarily SQL queries defined in my project.xml file.
It worked very well until I recently had to filter by date. I found this ticket which hasn't been touched for seven months:
https://issues.voltdb.com/browse/ENG-3008
So then I went to check the code, and found this file where FUNC_CURRENT_DATE is marked as disabled.
https://github.com/VoltDB/voltdb/blob/master/src/hsqldb19b3/org/hsqldb_voltpatches/FunctionSQL.java
All this is well and good, but I need this functionality and I don't have time to fix it. So then I tried testing a call like:
SELECT * FROM TABLE WHERE EXTRACT(DAY_OF_YEAR FROM Table.TimeCol) = EXTRACT(DAY_OF_YEAR FROM '2012-10-04 00:00:00')
except Volt doesn't like this either because apparently the extract function doesn't like parsing ISO date strings.
The best workaround I can think of for this would be querying where (Table.TimeCol BETWEEN '2012-10-04 00:00:00' AND '2012-10-05 00:00:00') but that seems a little excessive. Does anyone have any better ideas?