query problem

T

Tammy

Hello:
I've created a db and I'm sure it could have been done better/in a different
way. But here's the situation.

I've got 3 tables that make up my db.
Customers, CustomerHistory and PaymentHistory

My problem
I want to see my expired advertisers, but I don't want to see them IF they
have renewed their ad.

I don't want to see them on my expired_advertiser query IF the same customer
on CurrentAdvertiser Query.

Here's my fields for CurrentAdvertiserQuery
companyname
daterunbegan
dateexpires
amountpaid
billeddate
datepaid
dateappeared
customerid
adid

The fields from expiredads query are
companyname
dateexpires
daterunbegan
dateappeared
amountpaid
billeddate
datepaid
customerid
adid

I don't want to see them on my expired ads query if they're running another
advertising campaign on the current advertiser query.

I hope that makes sense and somebody can help me narrow down my expired ads
query.

MANY THANKS!
 
O

Ofer Cohen

Using a SubQery add to the expired_advertiser query under the a customerid
field a criteria

Not In(Select customerid From CurrentAdvertiser)

So it will show the customerid that are not in CurrentAdvertiser query
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top