By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Need help - Trouble with a query

P: 69
Hello all...

I'm having trouble with a query. Here's the situation:

I have two tables, one that holds client info and another that holds invoicing info.

The two tables have client number in common. All clients are in the client table but not necessarily in the invoice table.

I want to create a query that pulls client numbers that are not in the invoicing table (but are in the client table) based on a date range.

So client 1 could have a record in the invoice table dated 1/1/2005, but if I run this query and ask for a range of 1/1/2006 - 1/1/2007 then I want the query to return client 1. This tells me that I haven't invoiced the client during my specified date range.

It's seems simple to me but I can't get it to work...

Any ideas?

Mar 16 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,356
Something like the following should work.

SELECT ClientTable.Dated
FROM ClientTable LEFT JOIN InvoiceTable ON ClientTable.[client number]= InvoiceTable.[client number]
WHERE (((InvoiceTable.Dated) Not Between #8/16/2005# And #8/16/2006#));
Mar 16 '07 #2

P: 69

I got it. I basically had to nest a query within the main query at the point of the client number. This took care of it.

Thanks again for the great idea, it helped me get there.

Mar 16 '07 #3

Expert 100+
P: 1,356
Great glad ya got it and glad I could help.
Mar 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.