>Are there aggregate functions for MS SQL Server like 'First' or 'Last'?
>
There is TOP, MAX() and MIN() just like in VFP.
For First
SELECT TOP * FROM table ORDER BY field1
For Last
SELECT TOP * FROM table ORDER BY field1 DESC
MAX() and MIN() - using pubs database
SELECT stor_id, MIN(qty) AS min_qty, MAX(qty) AS max_qty
FROM sales
GROUP BY stor_id
Insanity: Doing the same thing over and over and expecting different results.