Showing posts with label included. Show all posts
Showing posts with label included. Show all posts

Friday, March 23, 2012

How to include total in query?

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

Wednesday, March 21, 2012

How to include more databases in DB Maintenance Plan ?

Hi,
I have created a DB maintenance plan to backup a production database daily.
There is a request to include 2 more databases to be included in the
maintenance plan. I have checked the maintenance plan but I am not able to
work out how to include 2 more databases.
Is it possible to give me some advice ?
ThanksPeter
Right Click on MP and then Properties . Add more user databases. Is that
what you mean?
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZusmMoIHHA.2456@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I have created a DB maintenance plan to backup a production database
> daily.
> There is a request to include 2 more databases to be included in the
> maintenance plan. I have checked the maintenance plan but I am not able
> to work out how to include 2 more databases.
> Is it possible to give me some advice ?
> Thanks
>|||Yes.
Peter
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:O8m1RToIHHA.780@.TK2MSFTNGP03.phx.gbl...
> Peter
> Right Click on MP and then Properties . Add more user databases. Is that
> what you mean?
>
> "Peter" <Peter@.discussions.microsoft.com> wrote in message
> news:OZusmMoIHHA.2456@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> I have created a DB maintenance plan to backup a production database
>> daily.
>> There is a request to include 2 more databases to be included in the
>> maintenance plan. I have checked the maintenance plan but I am not able
>> to work out how to include 2 more databases.
>> Is it possible to give me some advice ?
>> Thanks
>

How to include more databases in DB Maintenance Plan ?

Hi,
I have created a DB maintenance plan to backup a production database daily.
There is a request to include 2 more databases to be included in the
maintenance plan. I have checked the maintenance plan but I am not able to
work out how to include 2 more databases.
Is it possible to give me some advice ?
ThanksPeter
Right Click on MP and then Properties . Add more user databases. Is that
what you mean?
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZusmMoIHHA.2456@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I have created a DB maintenance plan to backup a production database
> daily.
> There is a request to include 2 more databases to be included in the
> maintenance plan. I have checked the maintenance plan but I am not able
> to work out how to include 2 more databases.
> Is it possible to give me some advice ?
> Thanks
>|||Yes.
Peter
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:O8m1RToIHHA.780@.TK2MSFTNGP03.phx.gbl...
> Peter
> Right Click on MP and then Properties . Add more user databases. Is that
> what you mean?
>
> "Peter" <Peter@.discussions.microsoft.com> wrote in message
> news:OZusmMoIHHA.2456@.TK2MSFTNGP06.phx.gbl...
>