Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select
- [PORT_DATE],
- Count (*) as [Loan Count], --this works fine
- sum(Case when [Closed or Fallen Out] ='c' then 1 else 0 end) as [Actual Closed Loans],--this works fine
- sum(Case when [Closed or Fallen Out] ='C' then 1 else 0 end)/count(*) as [Actual Closing Ratio], --although code works doesnt produce correct result, output for this variable is all zeros
- From dbo.XYZ
- Group by [PORT_DATE]
- order by [PORT_DATE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement