This topic is locked

MYSQL Calculation Issue

7/6/2016 3:31:53 AM
PHPRunner General questions
J
jefflau author

All,

I had been try my best solved the calculation issue, but failed. Where I did wrong I used annual_entitle where field had been calculated via query.

Hope that anyone able gave me the answer
(annual_entitle - annual_used) AS annual_balance,
SELECT

ID,

apployee_name,

emp_no,

username,

password,

emp_email,

position,

access_level,

emp_dept,

emp_date,

ROUND((DATEDIFF(NOW(), emp_date)-186)/365) * TIMESTAMPDIFF(YEAR,emp_date,Now()) AS annual_entitle,

medical_entitle,

ROUND(DATEDIFF(NOW(), emp_date)/7) AS off_entitle,

annual_used,

medical_used,

off_used,

(annual_entitle - annual_used) AS annual_balance,

(medical_entitle - medical_used) AS medical_balance,

(off_entitle - off_used) AS off_balance,

company_asset_entitle

FROM employee_information

Sergey Kornilov admin 7/6/2016

What is the question here? Results are wrong or there are some error messages?