February 10, 2014 at 1:37 pm
I am not sure whether this is correct or not ...
Can anyone tell me.
I am trying to take a count where both the values are "Yes" and Available.
IsnUll(CAST(Case when Emp_FullTime = 'Yes' and Emp_Status = 'Available' then 1 else 0 end AS VARCHAR(10)),0)as EmpCode
February 10, 2014 at 1:44 pm
something like this would give you the count that meets your condition, as well as the total count for a total
does this help?
SELECT
SUM(CASE
WHEN Emp_FullTime = 'Yes' AND Emp_Status = 'Available'
THEN 1
ELSE 0
END) AS EmpCodeCount,
COUNT(*) AS TotalCount
FROM YourTable
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply