Re: Grouping Dates
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 14 Dec 2005 22:25:55 +0000 (UTC)
msg (msg35803@xxxxxxxxx) writes:
> SELECT TOP 100 w.TimeDate AS [date], p.ProdCode, COUNT(w.BoxID) AS
> cases, AVG(w.PrintedWeight / w.PkgsPerBox) AS avgtrayweight
> FROM dbo.WIPSixtyDay w INNER JOIN
> dbo.Products p ON w.PLUNo = p.PLUNo
> WHERE (p.PrePack = 1) AND (w.PkgsPerBox > 0)
> GROUP BY w.TimeDate, p.ProdCode
> ORDER BY w.TimeDate
>
>
> This is what I need to do...... sum these by the date(w.timedate) my
> original I was converting it to a string, but then none of my date
> queries would work....
I'm sorry, but I will have to ask: what is the question?
--
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
.
- References:
- Grouping Dates
- From: msg
- Grouping Dates
- Prev by Date: Re: Sync to databases nightly with BLOB data
- Next by Date: Re: Stored Procedure to change default
- Previous by thread: Grouping Dates
- Next by thread: Re: Grouping Dates
- Index(es):
Relevant Pages
|