Function Usage on Index Columns

When using date and time functions on primary key or secondary index columns in a WHERE clause or table iterator filter string, the application of the function to the column, in the left side of an equation, does not reduce the number of rows being examined for a query. Indexes are calculated based on the actual value of a column and not the value that is the result of conversion by functions.

You can use the date and time functions in comparisons with key or index fields and still get the benefit of the key or index, if you use the function on the right-hand side of the equation. For example if the dtm column is of type datetime (holds tibDateTime objects) and dtm is defined as a secondary index, the following query only scans those rows with a date of 12-24 of the previous year:
SELECT * FROM mytable WHERE dtm < datetime('2018-06-01')
See the section on tibDateTime to understand the string forma is used in this example.