?
Solved

Working with paradox database.

Posted on 2003-03-01
5
Medium Priority
?
135 Views
Last Modified: 2010-04-04
I am trying to work out grades (A-D) using boundries stored in an paradox table.

I have 2 tables.

Table1: contains field 'Subject' with values English, Maths, Science etc. The other fields in the database are 'GradeA', 'GradeB', 'GradeC', 'GradeD'.

The grade boudries for:

English:
GradeA=  80%    
GradeB= 70%          
GradeC= 60%          
GradeD=  50%

Maths
GradeA=  90%    
GradeB=  80%          
GradeC=  70%          
GradeD= 60%

Science
Maths
GradeA=  85%    
GradeB= 75%          
GradeC= 65%          
GradeD= 55%

The other table;

Table2: contains a field called 'Grade'.

I want my program to work out the grade (A-D) for any particular subject using the grade boundries for that subject (grade boundires stored in Table1) and then store that grade (whether it is A,B,C,or D) in Table 2 field 'Grade'..

Examples with source code will be appreciated.

Cheers.
0
Comment
Question by:technicaldreamer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
mocarts earned 152 total points
ID: 8049172
I would prefer some other table1 structure:
Subject Grade Boundry
English A 80%
English B 70%

in this case you can simply select using SQL:
INSERT INTO TABLE2 (GRADE) SELECT Boundry * MyVar / 100 WHERE Subject='English' AND Grade='A'

in your case you should first find out field name (not hard to do :) and then use SQL again:

INSERT INTO TABLE2 (GRADE) SELECT GradeA * MyVar / 100 WHERE Subject='English'

in delphi code something like this:
Query1.SQL.Text := 'INSERT INTO TABLE2 (GRADE) SELECT Grade'+ sMyGradeVar +'* '+inttostr(dMyVar)+'/100 WHERE SUBJECT='+QuotedStr(sMySubject);

wbr, mo.
0
 

Assisted Solution

by:AFungus
AFungus earned 148 total points
ID: 8052089
You might consider more tables... Breaking down the data so it is not stored or entered more than once. A quick easy primer on table normalizing giving the five forms or normalizing is at: http://home.earthlink.net/~billkent/Doc/simple5.htm 
After the table is normalized, I would think a query of the datasets would best work for extracting the values and interpret them in the manner you want. This could even be coded in the program for expressing the value results from the query. If you express it as a query function, the ranges could be modified later without having to change tables or coding in the program.
0
 

Expert Comment

by:CleanupPing
ID: 9316999
technicaldreamer:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 9999568
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Split between mocarts and AFungus

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 10029505
Forced accept

Computer101
E-E Admin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question