On 25 May 2001, at 16:46, Mark Howard wrote:
> Hello
> I'm using Paradox.
>
> I want to achieve the following effect:
>
> Select into temp
> distinct a.forcode, a.comp from dockets a
> where a.docketdate > '31/03/2001';
>
> Delete from dockets b
> where not exists
> (select c.forcode from temp
> where b.forcode = temp.forcode
> and b.comp = temp.comp)
>
> BUT with Paradox I can't use the "into temp" syntax
>
> Can someone suggest another way of acheiving the same.
>
> In a nutshell, I want to delete all the rows from the dockets table where the
>forcode/comp combination
is not current (ie been used this financial year)
I will only let you use this answer if you put your system clock
back to today. :-) Furthermore, I don't guarantee it's correct, but
I think it accomplishes what you want to achieve:
delete from dockets d1 where not exists
(select forcode from dockets d2 where d1.forcode = d2.forcode and
d1.comp = d2.comp and d2.docketdate > '31/03/2001')
Seth.
=======================================================
Seth Wagoner, WebFoundry Ltd. Christchurch, New Zealand
mailto:[EMAIL PROTECTED] http://webfoundry.co.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"