If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do i set a value based on a data range
I want to perform a query on a database table with a 1:1 relationship. Given
the returned value of the query I want to create a new calculated field that assings a letter rating (A-D) based on data ranges. eg score = 05 then [newfield] = "A" 05 score = 10 then [newfield] = "B" 15 score = 20 then [newfield] = "C" 25 score = 30 then [newfield] = "D" Given this rating I want to then display it in a field in a form? Can anyone help with how to one or both of these? Thanks |
#2
|
|||
|
|||
Create another table for you Grades. This table should contain a
lowerBound, UpperBound, and a Grade fields. I've added a couple of rows because I wasn't too sure what you wanted to do with the range bands you left out. LowerBound UpperBound Grade -1 5 A 5 10 B 10 15 B- 15 20 C 20 25 C- 25 30 D Now create a query that uses your other query or table and this new GRADES table, it would look something like: Select T.StudentID, T.Score, G.Grade FROM YourFirstTable T, GRADES G WHERE T.Score G.LowerBound AND T.Score = G.UpperBound HTH Dale "matth" wrote in message ... I want to perform a query on a database table with a 1:1 relationship. Given the returned value of the query I want to create a new calculated field that assings a letter rating (A-D) based on data ranges. eg score = 05 then [newfield] = "A" 05 score = 10 then [newfield] = "B" 15 score = 20 then [newfield] = "C" 25 score = 30 then [newfield] = "D" Given this rating I want to then display it in a field in a form? Can anyone help with how to one or both of these? Thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
strategy for data entry in multiple tables | LAF | Using Forms | 18 | April 25th, 2005 04:04 AM |
Pulling data from 1 sheet to another | Dave1155 | Worksheet Functions | 1 | January 12th, 2005 05:55 PM |
Newbie? Do I use Report or Query | John Egan | New Users | 11 | June 28th, 2004 08:31 PM |
How to create graphs in a monthly report where the base data can change | John Clarke | Charts and Charting | 3 | June 25th, 2004 02:22 AM |
Y-Axis maximum based on data range | Jay | Charts and Charting | 3 | January 14th, 2004 06:18 PM |