Subject | Re: Selecting invoices between specific dates? |
---|---|
Author | legrand_legrand_63 |
Post date | 2006-12-09T21:34:52Z |
--- In firebird-support@yahoogroups.com, Robin Davis <Ro.Davis@...> wrote:
select distinct name from invoices a
where invoicedate >= '2006.01.01'
and not exists (select 1 from invoices b
where invoicedate < '2006.01.01'
and b.name=a.name )
regards
PAscal
>Could you try something like:
> Hi,
>
> I'm obviously missing something here.
>
> We have a table of invoices and we want to send Christmas cards to any
> NEW clients in 2006. I am trying to select by invoicedate, which is
> 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
>
select distinct name from invoices a
where invoicedate >= '2006.01.01'
and not exists (select 1 from invoices b
where invoicedate < '2006.01.01'
and b.name=a.name )
regards
PAscal