Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Working with paradox database.

Posted on 2003-03-01
5
Medium Priority
?
138 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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

580 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