Re: Need help with SQL satement - newbie
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 21 Apr 2006 21:51:24 +0000 (UTC)
(alanenglefield@xxxxxxxxx) 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@xxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: Need help with SQL satement - newbie
- From: alanenglefield
- Re: Need help with SQL satement - newbie
- References:
- Need help with SQL satement - newbie
- From: alanenglefield
- Need help with SQL satement - newbie
- Prev by Date: Re: Sum Accumulating Data
- Next by Date: Re: Disk or network error
- Previous by thread: Re: Need help with SQL satement - newbie
- Next by thread: Re: Need help with SQL satement - newbie
- Index(es):
Relevant Pages
|