A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do i set a value based on a data range



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2005, 01:18 AM
matth
external usenet poster
 
Posts: n/a
Default 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  
Old June 15th, 2005, 02:33 AM
Dale Fye
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 02:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.