# Thread: Weird Case Then problem

1. Registered User
Join Date
Mar 2008
Posts
40

## Unanswered: Weird Case Then problem

Code:
```CASE WHEN point >= (@total_point * 0.9) THEN 'A'
WHEN point >= (@total_point * 0.8) THEN 'B'
WHEN point >= (@total_point * 0.7) THEN 'C'
WHEN point >= (@total_point * 0.6) THEN 'D'
ELSE 'F'
END```
It's working on A, B, C, F. But not on D.

when student gets 60 point out of 100 point It's showing F.

2. Registered User
Join Date
Mar 2008
Posts
40
Well it turns out that. 0.6 and 6/10 are different anyhow. When I use 0.6 it doesn't work but when I use 6/10 it works.

3. World Class Flame Warrior
Join Date
Jun 2003
Location
Ohio
Posts
12,595
This works fine for me:
Code:
```declare	@point int
declare	@total_point int

set		@point = 60
set		@total_point = 100

select	CASE WHEN @point >= (@total_point * 0.9) THEN 'A'
WHEN @point >= (@total_point * 0.8) THEN 'B'
WHEN @point >= (@total_point * 0.7) THEN 'C'
WHEN @point >= (@total_point * 0.6) THEN 'D'
ELSE 'F'
END```
Result: "D"

4. King of Understatement
Join Date
Feb 2004
Location
One Flump in One Place
Posts
14,912
Is @total_point a float?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•