A
A
Anton Plawkevich2017-03-13 23:11:47
SQL
Anton Plawkevich, 2017-03-13 23:11:47

How to set comparison query as a percentage?

Tell me how to correctly compare SickLeaveHours > 20% VacationHours ,
SELECT LoginID
FROM HumanResources.Employee where (SickLeaveHours > 20*VacationHours) but it gives only 3 values ​​out of 1000, correct where the error is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iCune, 2017-03-13
@antowa_plawkevich

Your query will return records where SickLeaveHours is at least twenty times VacationHours.
It should be like this:

SELECT LoginID
FROM HumanResources.Employee 
WHERE (SickLeaveHours > 0.2*VacationHours)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question