Reply to Re: Adding Time Totals in SQL

Your name:

Reply:


Posted by Erland Sommarskog on 10/01/64 11:34

Bob W (blackjack8225_21@hotmail.com) writes:
> I am trying to get a total for times, but I am having trouble getting
> anything to work. Basically I created a query to pull up several
> people's name that performed certain details and how long each detail
> was. I now want to add up all the hours to a total for each person. Can
> anyone point me in the right direction?

SELECT name, totime = SUM(detaillength)
FROM tbl
GROUP BY name

For a more accurate answer, I recommend that you post:

1) CREATE TABLE statements for your tables.
2) INSERT statements with sample data.
3) The desired result given the sample.

This will very likely give you a tested solution.

The less information you disclose, the less accurate and the less
useful the answers will be.


--
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

[Back to original 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

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