Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Select
  2. [PORT_DATE],
  3. Count (*) as [Loan Count], --this works fine
  4. sum(Case when [Closed or Fallen Out] ='c' then 1 else 0 end) as [Actual Closed Loans],--this works fine
  5. 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
  6. From dbo.XYZ
  7. Group by [PORT_DATE]
  8. order by [PORT_DATE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement