Subject | Re: Selecting invoices between specific dates? |
---|---|
Author | colincoleman2002 |
Post date | 2006-12-09T21:26:49Z |
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 firebird-support@yahoogroups.com, Robin Davis <Ro.Davis@...>
wrote:
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 firebird-support@yahoogroups.com, Robin Davis <Ro.Davis@...>
wrote:
>any
> 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, whichis
> straight forward, but how in hell do I select people from thatlist who
> we have billed in 2006 but NOT in previous years?
>
> Sorry, my brain has gone to mush!
>
> Rob Davis
>