I'll admit that I'm a new MSSQL query writer; however, I'm learning.
I'm curious how I could get a GRAND TOTAL to be included directly under
the [Total] column. Any information would be great!
Thank you!
SELECT Sites.Name [Signups Before 4pm], COUNT(Subscribers.Id) [Total]
FROM Subscribers
JOIN Sites on Sites.Id = Subscribers.SiteId
WHERE Subscribers.DateEntered BETWEEN @.beforestart AND @.beforeend AND
DateOptedOut IS NULL
GROUP BY Sites.Name
ORDER BY Sites.NameTry something like this:
SELECT Sites.Name [Signups Before 4pm], COUNT(Subscribers.Id) [Total]
FROM Subscribers
JOIN Sites on Sites.Id = Subscribers.SiteId
WHERE Subscribers.DateEntered BETWEEN @.beforestart AND @.beforeend AND
DateOptedOut IS NULL
GROUP BY Sites.Name
ORDER BY Sites.Name
COMPUTE SUM(COUNT(Subscribers.Id))|||I really appreciate your help with this. However, I get the following
error:
TDS Protocol error: Unsupported TDS token: 0x88
Thanks again!|||You might also check out the WITH ROLLUP option on GROUP BY
"JeffB" wrote:
> Try something like this:
> SELECT Sites.Name [Signups Before 4pm], COUNT(Subscribers.Id) [Total]
> FROM Subscribers
> JOIN Sites on Sites.Id = Subscribers.SiteId
> WHERE Subscribers.DateEntered BETWEEN @.beforestart AND @.beforeend AND
> DateOptedOut IS NULL
> GROUP BY Sites.Name
> ORDER BY Sites.Name
> COMPUTE SUM(COUNT(Subscribers.Id))
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment