I have a table (l.loandeterminationscore) that returns a result consisting of 3 #'s (XXX). I am using the below query to separate that result into a LowRange and a HighRange so that I may group the results returned into one result "XXX-XXX".
SELECT
l.LoanNumber,
l.LoanDeterminationScore 'FICO',
FLOOR (l.LoanDeterminationScore / 20) * 20 AS LowRange,
FLOOR (l.loanDeterminationScore / 20) * 20 + 19 AS HighRange
FROM
loan.LoanQA l
WHERE
l.FundedDate = '10/15/2013'
The results returned from the above are something like this:
LoanNumber FICO LowRange HighRange
-----------------------------------
592301428 604 600 619
220300002 640 640 659
414805244 675 660 679
I'm trying to group the above FICO into a 20pt Range with the LowRange and HighRange. So in short, rather than having the two columns for the LowRange and HighRange I'd like it to return as one column showing the range as "600-619", "640-659", "660-679".
I've tried to CONCAT expression but I continually receive a "Syntax" error.
CONCATis a new command in SQL Server 2012