Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-12-13 : 07:36:50
|
| Praxeda writes "Hello,I need to create a function that when passed two columns from two different tables will return the student grades for a classGrade = 4 when percentage is 90 or above3 when percentage is 80 or above this continues till you get to 0 when percentage is below 60.I've been working on this all day and I can't figure it out.I'm stuck on Triggers too, I read your articles, but I still am trying to figure them out.Thanks,Praxeda (This a real not made up name)" |
|
|
yonabout
Posting Yak Master
112 Posts |
Posted - 2005-12-13 : 08:00:23
|
| Hi, What are the values being input into the function? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-13 : 08:12:47
|
| Select columns,Grade=case when percentage >= 90 then 4when percentage >= 90 then 4when percentage >= 80 then 3when percentage >= 70 then 2..end from yourTableOtherwise post table structures, sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|