You are here: Re: Need help with SQL satement - newbie « MsSQL Server « IT news, forums, messages
Re: Need help with SQL satement - newbie

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация