Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Compare Two Data-Sets

Posted on 2011-03-14
5
Medium Priority
?
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Assisted Solution

by:sshah254
sshah254 earned 600 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 600 total points
ID: 35135438
0
 
LVL 7

Accepted Solution

by:
foobarr earned 800 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

604 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