R
Robert Suffecool
Hi everyone,
I am trying to reconcile two tables with one another. Each table can
have multiple records for each customer. Table one has records of
outstanding bills. Bills that have been paid are listed in the second
table. I need to figure out a way to determine which customer bills have
not been paid yet. Here is an example of the data in each table...
Here is a sample of the invoice table...
Tran_Date Customer Invoice
15-Nov-03 1 $711.18
15-Nov-03 1 $1,043.15
15-Nov-03 1 $990.01
15-Nov-03 1 $69.53
Here is a sample of the Paid Table...
Date Paid Customer AmtPaid
01-Dec-03 1 $711.18
01-Dec-03 1 $990.01
01-Dec-03 1 $1,043.15
Here is what happens when I create an Inner Join...
AcctNum AmtPaid Invoice
1 $711.18 $69.53
1 $711.18 $711.18
1 $711.18 $990.01
1 $711.18 $1,043.15
1 $990.01 $69.53
1 $990.01 $711.18
1 $990.01 $990.01
1 $990.01 $1,043.15
1 $1,043.15 $69.53
1 $1,043.15 $711.18
1 $1,043.15 $990.01
1 $1,043.15 $1,043.15
As you can see, the only invoice that customer #1 hasn't paid yet is the
one in the amount of $69.53.... How can I create a SQL statement to select
only those records? Any ideas?
Sincerely,
Robert
I am trying to reconcile two tables with one another. Each table can
have multiple records for each customer. Table one has records of
outstanding bills. Bills that have been paid are listed in the second
table. I need to figure out a way to determine which customer bills have
not been paid yet. Here is an example of the data in each table...
Here is a sample of the invoice table...
Tran_Date Customer Invoice
15-Nov-03 1 $711.18
15-Nov-03 1 $1,043.15
15-Nov-03 1 $990.01
15-Nov-03 1 $69.53
Here is a sample of the Paid Table...
Date Paid Customer AmtPaid
01-Dec-03 1 $711.18
01-Dec-03 1 $990.01
01-Dec-03 1 $1,043.15
Here is what happens when I create an Inner Join...
AcctNum AmtPaid Invoice
1 $711.18 $69.53
1 $711.18 $711.18
1 $711.18 $990.01
1 $711.18 $1,043.15
1 $990.01 $69.53
1 $990.01 $711.18
1 $990.01 $990.01
1 $990.01 $1,043.15
1 $1,043.15 $69.53
1 $1,043.15 $711.18
1 $1,043.15 $990.01
1 $1,043.15 $1,043.15
As you can see, the only invoice that customer #1 hasn't paid yet is the
one in the amount of $69.53.... How can I create a SQL statement to select
only those records? Any ideas?
Sincerely,
Robert