im_num_employees_simple

one of the documented procedures in this installation of the ACS
Usage:
im_num_employees_simple   { db "" }
What it does:
Returns # of employees.
Defined in: /web/philip/tcl/intranet-defs.tcl

Source code:


    if { [empty_string_p $db] } {
	set db [ns_db gethandle subquery]
	set release 1
    } else {
	set release 0
    }
    set num_employees [database_to_tcl_string $db  "select count(time.percentage_time) 
               from im_employees_active info, im_employee_percentage_time  time
              where (time.percentage_time is not null and time.percentage_time > 0)
                and (info.start_date < sysdate)
                and time.start_block = to_date(next_day(sysdate-8, 'SUNDAY'), 'YYYY-MM-DD')
                and time.user_id=info.user_id"]

    if { $release } {
	ns_db releasehandle $db
    }
    return $num_employees


philg@mit.edu