Last

S

Sylvain Lafontaine

None. (And BTW, there is no First() either.)

By using the proper combination of TOP, ORDER BY, DISTINCT, GROUP BY and
Sub-query, you can probably design a query that will give you the same
result with T-SQL as the use of Last() in MS Access.
 
D

David Portas

what command in SQL Server is equable "last" in MS Access?

According to the Access help file, FIRST and LAST return values from
some arbitrary row in your query. Since the correct result is
undefined there perhaps isn't a good answer to your question. A better
question would be, what result did you expect from LAST? Maybe you
could use the MIN or MAX aggregate instead.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
 
A

aaron.kempf

yes, min or max work great

you might need to write a where clause and an order by though LoL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top