473,382 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Grading Values

7 of 9
23
Hello all,

Here is my question. I have a query that calculates the average weight of an item. I would like to assign that weight to a predefined grade. Let’s say I have the following grading scale:

Grade Range
A 0-999
B 1000-99999
C 100000-999999


If the Average weight of Item X is 5000 lbs i want the Grade column to return a "B"

How can I do this?

-Thanks
Feb 14 '08 #1
1 1481
FishVal
2,653 Expert 2GB
Hi, there.

I'd like to suggest you the following solution.
Create and fill with an appropriate values a table (if not yet) with the following structure:
Expand|Select|Wrap|Line Numbers
  1. tblGrades
  2.  
  3. txtGradeName     Text
  4. lngLowerLimit      Number(Long)
  5. lngUpperLimit      Number(Long)
  6.  
Then join it with the query returning mentioned average (let us say the field has name [qryAverage].[Average]):
Expand|Select|Wrap|Line Numbers
  1. SELECT [qryAverage].*, tblGrades.txtGradeName FROM [qryAverage] LEFT JOIN tblGrades ON [qryAverage].[Average]>=tblGrades.lngLowerLimit AND [qryAverage].[Average]<=tblGrades.lngUpperLimit;
  2.  
Regards,
Fish
Feb 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steve Hall | last post by:
Folks, My secnario involves two tables - ObservationRegister, and Person. ObservationRegister contains most of the "useful" fields, including the UserID of the person that raised the record, and...
0
by: C.E.O. Gargantua | last post by:
http://blog.seattlepi.nwsource.com/microsoft/ Featured in the blog: Grading Bill Gates Charles Cooper, CNet News.com executive editor, assesses the performance of Bill Gates as the company's...
6
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
2
by: Hennie | last post by:
I apologise if this is a stupid question, but I would appreciated any help on this subject. I want to create a view (VIEW_1 in example below) where I take numeric values from a field in one...
3
by: Akinyemi | last post by:
I am writing a Visual Basic program for calculating students scores, and also grading the highest 3 scores as "First" , "Second" and "Third" respectively. I have been able to get the program to...
4
by: hjc | last post by:
i am trying to created a program that will write a grading program for a class with the following policies there are 2 quizzes each graded on the basis of 10 points there is 1 midterm and 1...
17
by: Brian Blais | last post by:
Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the students to go through a lot of very small programs, to learn the...
9
by: Grimmjow04 | last post by:
first of all, im a beginner with this thing.. turbo C,, my prof gave us a homework: we must do a grading system consist of: format>>> Grading System Enter your name:
8
by: gigonomics | last post by:
Hi all, I hope someone can help me out. I need to return the best available seats subject to the constraint that the seats are side by side (or return X consecutive records from a table column...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.