"Employee Detail Report" 'ADODB_Exception'

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
vmp
Posts: 99
Joined: Wed Jun 20, 2007 3:41 am

"Employee Detail Report" 'ADODB_Exception'

Post by vmp »

We are unable to run the Employee Detail report.
Debug output as below.
Hope you can isolate the SQL error.

###################################
--------------------------------------------------------------------------------
(mysqlt): SET SESSION sql_mode='ansi'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): SET SESSION time_zone='GMT'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = '556776e753e8ee1c368a49425c869592' AND ip_address = '62.150.224.88' AND updated_date >= 1194782920
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): update authentication set updated_date = 1194797320 where session_id = '556776e753e8ee1c368a49425c869592'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): SET SESSION time_zone='Asia/Kuwait'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select * from station where company_id = '1' AND station_id = 'e64443378505be5386ae111213d8664c' AND deleted = 0
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select d.severity_id as severity_id, count(*) as count from exception as a LEFT JOIN user_date as b ON a.user_date_id = b.id LEFT JOIN users as c ON b.user_id = c.id LEFT JOIN exception_policy as d ON a.exception_policy_id = d.id LEFT JOIN pay_period as e ON b.pay_period_id = e.id where b.user_id = '1' AND b.date_stamp < '2007-11-11' AND e.status_id = 10 AND NOT EXISTS ( select z.id from request as z where z.user_date_id = a.user_date_id AND z.status_id = 30 ) AND ( a.deleted = 0 AND b.deleted = 0 AND e.deleted=0) GROUP BY d.severity_id ORDER BY d.severity_id desc
--------------------------------------------------------------------------------
/home/xxx/public_html/TimeTrex/var/timetrex/cache//a4/adodb_a47e439a7316c700be66a9b931749faa.cache reloaded, ttl=46486 [ select * from users where id = -1 ]

--------------------------------------------------------------------------------
(mysqlt): select a.* from users as a LEFT JOIN branch as b ON a.default_branch_id = b.id LEFT JOIN department as c ON a.default_department_id = c.id LEFT JOIN user_group as d ON a.group_id = d.id LEFT JOIN user_title as e ON a.title_id = e.id where a.company_id = '1' AND a.id in ('1') AND a.default_department_id in ('5') AND a.deleted = 0 order by status_id asc,last_name asc,first_name asc,middle_name asc
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select * from user_title where company_id = '1' AND deleted = 0
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select * from branch where company_id = '1' AND deleted = 0
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select * from department where company_id = '1' AND deleted = 0
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): ( select b.* from users as a, user_wage as b where a.id = b.user_id AND a.company_id = '1' AND b.effective_date >= '2007-11-01 00:00:00' AND b.effective_date <= '2007-11-30 00:00:00' AND b.user_id in ('1') AND (a.deleted = 0 AND b.deleted=0) ) UNION ( select m.* from user_wage as m where m.id in ( select max(d.id) as id from users as c, user_wage as d where c.id = d.user_id AND c.company_id = '1' AND d.effective_date <= '2007-11-01 00:00:00' AND d.user_id in ('1') AND (c.deleted = 0 AND d.deleted=0) group by d.user_id ) ) ORDER BY effective_date desc
--------------------------------------------------------------------------------
/home/xxx/public_html/TimeTrex/var/timetrex/cache//f4/adodb_f45ac6f931cb5cbaf66c688ccdc6d026.cache reloaded, ttl=45927 [ select * from over_time_policy where id = -1 ]

--------------------------------------------------------------------------------
(mysqlt): select * from over_time_policy as a where company_id = '1' AND deleted = 0 order by type_id asc,trigger_time desc
--------------------------------------------------------------------------------
/home/xxx/public_html/TimeTrex/var/timetrex/cache//b8/adodb_b8c564b3ad6cd1d98f0d96cde48f4df4.cache reloaded, ttl=46486 [ select * from absence_policy where id = -1 ]

--------------------------------------------------------------------------------
(mysqlt): select * from absence_policy as a where company_id = '1' AND deleted = 0 order by type_id asc
--------------------------------------------------------------------------------
/home/xxx/public_html/TimeTrex/var/timetrex/cache//8e/adodb_8e89048b4e6b4d164af515640a54856a.cache reloaded, ttl=45927 [ select * from premium_policy where id = -1 ]

--------------------------------------------------------------------------------
(mysqlt): select * from premium_policy as a where company_id = '1' AND deleted = 0 order by type_id asc
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select user_id, avg(total) as avg, min(total) as min, max(total) as max from ( select a.user_id, (EXTRACT(month FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) as date, count(*) as total from user_date as a, users as b where a.user_id = b.id AND b.company_id = '1' AND a.date_stamp >= '2007-11-01' AND a.date_stamp <= '2007-11-30' AND a.user_id in ('1') AND exists( select id from punch_control as z where z.user_date_id = a.id AND z.deleted=0 ) AND ( a.deleted = 0 AND b.deleted=0 ) GROUP BY user_id,(EXTRACT(month FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) ) tmp GROUP BY user_id
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
(mysqlt): select user_id, avg(total) as avg, min(total) as min, max(total) as max from ( select a.user_id, (EXTRACT(week FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) as date, count(*) as total from user_date as a, users as b where a.user_id = b.id AND b.company_id = '1' AND a.date_stamp >= '2007-11-01' AND a.date_stamp <= '2007-11-30' AND a.user_id in ('1') AND exists( select id from punch_control as z where z.user_date_id = a.id AND z.deleted=0 ) AND ( a.deleted = 0 AND b.deleted=0 ) GROUP BY user_id,(EXTRACT(week FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) ) tmp GROUP BY user_id
--------------------------------------------------------------------------------
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'week FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) as date, ' at line 7

ADOConnection._Execute(
select user_id,
avg(total) as avg,
min(total) as min,
max(total) as max
from (

select a...) % line 842, file: adodb.inc.php
ADOConnection.Execute(
select user_id,
avg(total) as avg,
min(total) as min,
max(total) as max
from (

select a..., Array[4]) % line 480, file: UserDateListFactory.class.php
UserDateListFactory.getDaysWorkedByTimePeriodAndUserIdAndCompanyIdAndStartDateAndEndDate(week, Array[1], 1, 1193864400, 1196370000) % line 228, file: UserDetail.php


Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysqlt error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'week FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) as date, ' at line 7] in EXECUTE(" select user_id, avg(total) as avg, min(total) as min, max(total) as max from ( select a.user_id, (EXTRACT(week FROM a.date_stamp) || '-' || EXTRACT(year FROM a.date_stamp) ) as date, count(*) as total from user_date as a, users as b where a.user_id = b.id AND b.company_id = '1' AND a.date_stamp >= '2007-11-01' AND a.date_stamp <= '2007-11-30' AND a.user_id in ('1') AND exists( select id from punch_control as z where z.user_date_id = a.id AND z.deleted=0 ) AND ( a.deleted = 0 AND b.deleted=0 ) GROUP BY user_id,(EXTRACT(week FROM a in /home/xxx/public_html/TimeTrex/classes/adodb/adodb-exceptions.inc.php on line 78
######################################
vmp
Posts: 99
Joined: Wed Jun 20, 2007 3:41 am

Post by vmp »

I think I found the problem,...
My SQL version is v4.1.22 and the WEEK function is failing.
I think that's the problem.
I wanted to delete the post.. but cant...

Do correct me if i'm wrong...
Locked