Solved

Compare Two Data-Sets

Posted on 2011-03-14
5
342 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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