Solved

Compare Two Data-Sets

Posted on 2011-03-14
5
336 Views
Last Modified: 2012-05-11
Hi Experts!

I am modifying an app that was handed on to me...

I need to compare insurance claims at two points in time.  I only need to report claims that have changed in value from Date 1 to Date 2 based on certain values; i.e. Total_Paid for example.  

I have two stored procedures that pull claim data as of 1/1/2010 and then another that pulls the claim data as of 1/1/2011.  I then want to compare Total_Paid_Amount_2010 to Total_Paid_Amount_2011. If its different, I write both records to a text file.

I'm  not familiar with datasets, datatables, etc.  Is this the best way to do  this?  Could anyone provide a generic example of obtaining the dataset, putting into data tables and then comparing the data.  I'm under a very tight time constraint....
0
Comment
Question by:tobin46
5 Comments
 
LVL 9

Assisted Solution

by:sshah254
sshah254 earned 150 total points
ID: 35134656
I would do this in SQL if I were you.  It will be much faster there.

Essentially there will be a table, or bunch of tables that hold the data for the claim.

But if you are unfamiliar with SQL, or do not have the schema of your database, then you should stick to what is familiar to you.

Ss
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134734
I'm much better in SQL than VB.Net.  Can you provide an example as to how I could accomplish it there....

The stored procedure is rather long and complicated because of the database schema.  

Can you provide a generic example, logic, psuedocode...?
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134749
I'd prefer a Vb.Net solution.....I think.  Only because this has a few moving parts to it outside of the claim comparison.  
0
 
LVL 16

Assisted Solution

by:Kalpesh Chhatrala
Kalpesh Chhatrala earned 150 total points
ID: 35135438
0
 
LVL 7

Accepted Solution

by:
foobarr earned 200 total points
ID: 35150838
if you have two datasets

dset1
dset2

for each dRow1 as datarow in dset1.tables(0).rows
     for each drow2 as datarow in dset2.tables(0).rows
            if drow1("column name") = drow2("column name")
                     'condition is true
                     exit for
           else
                     'condition is false
           end if
     next
next


basically you take the first dataset, for each row in that dataset you compare it against all of the rows in the second dataset.  For your condition statement, whatever you are checking, if you have found what you are looking for then you can exit the second for loop and then it will check the next row all over again.


but I would suggest doing this comparison in sql in your database.  
what does your stored procedure look like right now?




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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
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.…

947 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

22 Experts available now in Live!

Get 1:1 Help Now