Add missing parameterized arguments in get_time_clause
Cleanup
Fix year parameters
Fix syntax error