Skip to Content
0
Former Member
Jan 22, 2009 at 09:35 PM

Grouping a range of numbers into a like group

109 Views

I am trying to group credit scores by risk value. The data that I'm pulling in is a number an I want to convert it to a letter.

So anything over a score of 700 is A credit for example. Anything between 660 and 699 is B Credit, between 630 and 659 would be C Credit and so on.

Currently the data comes in from the databas as a string field(dont make sense to me either), the string field is a number anywhere from 0 to 800. I do understand that I will have to convert the string to a number and then probably a SELECT CASE statement, but I'm lost from there. My current select case looks like this

select CDbl({APPLIC_DATA.AP_RISK_SCORE})

Case Is >= 700:

"A"

Case 660 To 699:

"B"

Case 630 To 659:

"C"

Case 580 To 629:

"D"

Case 1 To 579:

"E"

Case 0:

"No Score"

This is not working for me. I was thinking that it would change my numbers in this field to the correct letter that corresponds to that number and I could group from there, but that obviously is not what is happening.

Any help would be appreciated.