I think I've asked this before, and I think the answer was "oracle
only"... but is there a way to select only the first/last record that
matches your query?
I have the following query:
SELECT
ConfigurationID, StartDate
FROM
Configuration C
WHERE
C.StartDate
BETWEEN
(
SELECT
MIN(DateTimeAdded)
FROM
ImportData
WHERE
FilterResult <> 2 AND DateTimeAdded IS NOT NULL AND Val IS NOT NULL
) AND (
SELECT
MAX(DateTimeAdded)
FROM
ImportData
WHERE
FilterResult <> 2 AND DateTimeAdded IS NOT NULL AND Val IS NOT NULL
)
ORDER BY
StartDate
Which looks to do what I want, apart from not returning the configuration
that starts just before the first DateTimeAdded in ImportData.
Is there anyway I can do this in one SQL statement? (against a paradox
table).
Mark
--
Mark Derricutt, Software Developer
Getting jiggy with The Tea Party - Triptych in NZ (29/9/99 - Auckland, NZ)
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz