Subject | Re: [firebird-support] Re: Selecting invoices between specific dates? |
---|---|
Author | Robin Davis |
Post date | 2006-12-09T23:24:09Z |
Hi,
Rob
>> I'm obviously missing something here.That's great, it works like a charm. Thanks to you both!
>>
>> 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!
>>
>>
> Could you try something like:
>
> 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 )
>
Rob