Subject Re: Selecting invoices between specific dates?
Author colincoleman2002
Maybe somthing like

select Distinct i.customer , i.custref
from invoices I
where inv_date between '1 jan 2006' and '31 dec 2006'
and not exists (select x.custref
from invoices x
where x.custref = i.custref
and x.inv_date < '1 jan 2006')

Sort of

Any help ?

--- In, Robin Davis <Ro.Davis@...>
> Hi,
> I'm obviously missing something here.
> We have a table of invoices and we want to send Christmas cards to
> NEW clients in 2006. I am trying to select by invoicedate, which
> straight forward, but how in hell do I select people from that
list who
> we have billed in 2006 but NOT in previous years?
> Sorry, my brain has gone to mush!
> Rob Davis