What is the problem of multi-table operation comparison? Waiting online !!

Source: Internet
Author: User
What is the problem of multi-table operation comparison? Waiting online !! Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061216123719269.html
Please help me! I have two data tables: basic data table (number, data type, data item, indicator upper bound, indicator lower bound, standard score) and data collection table (number, collected data, score, date ), first, let the user select a data type, and extract the corresponding numbers and data items from the basic data table according to the selected data type into the data collection table, then, let the user fill in the corresponding data in the collected data field, and then compare the entered data with the upper bound and lower bound of indicators in the basic data table. If the value exceeds the upper limit, the corresponding standard score is reduced, write the actual score to the score field in the data collection table. how can we implement it in Delphi? Can you give me some ideas and corresponding Program For my reference !!! Urgent!

The idea is clear.
1. First, you can find the metrics in the previous and next queries and store them in variables.
2. query the required types and data based on the selected type.
3. Compare the variables for calculation and store them in the database using SQL statements.

Can you give me an example of a program? I'm a beginner, and I don't know where to start if I have some ideas! Please help!

I understand what smallhand said, but you may not understand my data. My data collection table belongs to the time record table, the data recorded each time is different from the original one. Therefore, each time you enter a data number, You must select a data number as long as you want to enter the collected data, these data numbers are classified into several data types. Therefore, when you select a data type, you can enter the corresponding data before performing comparative operations!

Your idea is clear. If there is a ComboBox on the interface, fill in the [data type] In formcreate,

Then find the selected record select * from basic data table where data type = trim (ComboBox. Text)

Then fill in the data into the corresponding edit, edit_bh.text: = dataset. fieldbyname ('number'). Value
... (Except for the score)
Finally, determine the upstream and downstream of the indicator and set the standard score
With adodataset do
Begin
If (X: = fieldbyname ('indicator upper boundary ')-fieldbyname ('indicator lower boundary')> 0 then
Edit_df.text: = fieldbyname ('standard score ')-X;
End;
Submit data
With adocommand do
Begin
Try
Commandtext: = 'insert into data collection table values (: BH,: cjsj,: DF,: RQ )';
Parameters. parameterbyname ['bh ']. Value: = BH;
Parameters. parameterbyname ['cjsj ']. Value: = cjsj;
Parameters. parameterbyname ['df ']. Value: = DF;
Parameters. parameterbyname ['rq']. Value: = RQ;
Execute;
Except

End;
End;

Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.