Solved

Comparing 2 tables in Delphi 1.0 or Reportsmith(sql)

Posted on 1997-10-17
2
159 Views
Last Modified: 2010-04-04
hi....

I need to comapre 2 tables of same format(one old, one updated) the field values being yes/no. I need to produce a discepency report where only the unmatched fields are displayed.

I have an idea :
Take field values from both tables and place them in variables in Delphi then comparing them and outputting the unmatched variables to a new tempororay table that is eliminated after this report is generated.

How would you suggest that I solve this problem. Should I use Delphi 1.0 or should I use Reportsmith for processing.

Yours Sincerely
sprawler
0
Comment
Question by:sprawler
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1347822
I have another idea,
Define in one of the tables an calculated field. Then in OnCalcFields Event. Check the two fields and place the result in the calculated field.

procedure TForm1.OnCalcFields..........;
begin
Table2.FieldByName([NoMatch]).AsBoolean :=
(Table1.FieldByName([Value]).AsString <> Table2.FieldByName([Value]).AsString)
end;

After this filter this table on all the values with nomatch = true;

Look out! Two tables have to be in sync.

For making report, it depends. If you want to make a very beautifull layout, you should use reportsmith or Quickreport. But if you use reportsmith you have to deploy that program as wel with your own program. If you just want to have a print-out, I advise to use Delphi. With Delphi you can also make beautiful reports but that takes a little more time and isn't so easy.
Wich program to process? Depends on which you take to make your report.
But if yuo plan to use the results also for other processing, use D1. I don't know if you know it but you can also use sql in D1, not only in reportsmith.

Have fun,
c.u. ZifNab;
0
 

Author Comment

by:sprawler
ID: 1347823
Hi ...

 That is a good idea ....

I do now about the SQL capabilities of Delphi but I am not fully clued up on SQL code. If possible, would you pleez suggest how
I shoul make use of the SQL. An example will help tremendously.

Tanx
sprawler


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now