G
Greg
I am trying to do something that I believe requires nested SQL. I am having
a devil of a time with understanding how nesting works!!
Here is what I am trying to do:
Query has 1 table as input. The table has a multifield key.
Table is called Invoice
Structure of the table is:
TelephoneNumber, InvoiceDate, RecurringCharge, MinUsed
3342227777,08/01/2006,100.00,25
3342227777,09/01/2006,111.00,26
3342227777,10/01/2006,80.00,15
3342227777,11/01/2006,135.00,40
8342229999,08/01/2006,100.00,25
8342229999,09/01/2006,111.00,26
7342228888,08/01/2006,100.00,25
7342228888,09/01/2006,111.00,26
7342228888,10/01/2006,80.00,15
7342228888,11/01/2006,135.00,40
3342220000,10/01/2006,88.00,15
3342220000,11/01/2006,134.00,40
The key fields are TelephoneNumber and InvoiceDate.
I would like to ba able to have 2 Queries:
The first Query would Identify all Telephone numbers deleted between
09/01/2006 and 10/01/2006. I know number 834222999 is deleted because the
last month is 09/01/2006 and there is no month 10 record. The output from
the query would be all fields for 8342229999.
The second query would identify all telephone numbers added between
09/01/2006 and 10/01/2006. I know number 3342220000 is added because the
first month is 10/01/2006 and there is no month 9 record. The output from
this query would be all fields for 3342220000.
Is this doable? I am far from an expert at SQL or VBA. Does anyone have any
suggestions on how to do this??
Thank You,
Greg
a devil of a time with understanding how nesting works!!
Here is what I am trying to do:
Query has 1 table as input. The table has a multifield key.
Table is called Invoice
Structure of the table is:
TelephoneNumber, InvoiceDate, RecurringCharge, MinUsed
3342227777,08/01/2006,100.00,25
3342227777,09/01/2006,111.00,26
3342227777,10/01/2006,80.00,15
3342227777,11/01/2006,135.00,40
8342229999,08/01/2006,100.00,25
8342229999,09/01/2006,111.00,26
7342228888,08/01/2006,100.00,25
7342228888,09/01/2006,111.00,26
7342228888,10/01/2006,80.00,15
7342228888,11/01/2006,135.00,40
3342220000,10/01/2006,88.00,15
3342220000,11/01/2006,134.00,40
The key fields are TelephoneNumber and InvoiceDate.
I would like to ba able to have 2 Queries:
The first Query would Identify all Telephone numbers deleted between
09/01/2006 and 10/01/2006. I know number 834222999 is deleted because the
last month is 09/01/2006 and there is no month 10 record. The output from
the query would be all fields for 8342229999.
The second query would identify all telephone numbers added between
09/01/2006 and 10/01/2006. I know number 3342220000 is added because the
first month is 10/01/2006 and there is no month 9 record. The output from
this query would be all fields for 3342220000.
Is this doable? I am far from an expert at SQL or VBA. Does anyone have any
suggestions on how to do this??
Thank You,
Greg