|
Posted by Erland Sommarskog on 04/22/06 00:51
(alanenglefield@gmail.com) writes:
> The statement needs to pull in details from a table. If there are more
> than one record for a given 'siteID' then it needs to total (sum) most
> of the fields, however, there are three fields in which it needs to
> pull the _latest_ value through. The original statement uses 'last' to
> achieve this but this approach seems to rely on the data being input in
> the correct order which is not always the case.
Judging from the syntax, you are not using SQL Server (which is what
we know in this newsgroup). Judging from how the date is delimited,
I would guess that you are using Access. In that case you are
probably better off in comp.databases.ms-access. They may even know
what the last() function does.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|