Commit e813f03e authored by Frank Bergmann's avatar Frank Bergmann

- fixed absences syntax error in SQL with "last 4 month"

parent 03d2a3ef
......@@ -128,16 +128,16 @@ if { ![empty_string_p $user_selection] } {
if { ![empty_string_p $absence_type_id] && $absence_type_id != -1 } {
#ns_set put $bind_vars absence_type_id $absence_type_id
lappend criteria "a.absence_type=:absence_type_id"
lappend criteria "a.absence_type_id = :absence_type_id"
}
switch $timescale {
"all" { }
"today" { lappend criteria "a.start_date = '[db_string get_today "select sysdate from dual"]'" }
"next_1m" { lappend criteria "a.start_date < '[db_string get_next_month "select add_months(sysdate,1) from dual"]' and a.start_date >= '[db_string get_today "select sysdate from dual"]'" }
"today" { lappend criteria "a.start_date::date <= now()::date and a.end_date >= now()::date" }
"next_1m" { lappend criteria "a.start_date < now()::date + 30 and a.end_date >= now()::date" }
"past" { lappend criteria "a.start_date < '[db_string get_today "select sysdate from dual"]'" }
"future" { lappend criteria "a.start_date > '[db_string get_today "select sysdate from dual"]'" }
"last_3m" { lappend criteria "a.start_date > '[db_string get_3_months_ago "select add_months(sysdate,-3) from dual"]' and a.start_date < '[db_string get_today "select sysdate from dual"]'" }
"last_3m" { lappend criteria "a.start_date < now()::date and a.end_date >= now()::date - 120" }
}
set order_by_clause ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment