Is there a way to get a SQL Stored Procedure to count the number of rows returned and then store that total in a variable?A procedure? Number of rows returned? From where/what?
@.@.rowcount - Returns the number of rows affected by the last statement.
Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts
Friday, February 17, 2012
Tuesday, February 14, 2012
Count(IIF) not working
Hello, I have been fighting with getting the following statement to work
=Count(IIF( Fields!PDDAYS.Value>30,1,0))
I basically have returned all records to get a total count and need to weed
out those I want so I can divide the [totalofallrecords] by the
[totalofthose>30daysdue]
Any help would be appreciated.
SonjaI suppose you really want the Sum() aggregate, rather than Count(). Count
works the same way as it works in SQL - every value different than NULL will
be counted.
Try this (inside a data region - e.g. in a table header/footer etc.):
=Sum(IIF( Fields!PDDAYS.Value>30,1,0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"SLB" <SLB@.discussions.microsoft.com> wrote in message
news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> Hello, I have been fighting with getting the following statement to work
> =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> I basically have returned all records to get a total count and need to
> weed
> out those I want so I can divide the [totalofallrecords] by the
> [totalofthose>30daysdue]
> Any help would be appreciated.
> Sonja|||Thanks so much, worked like a charm. Don't know what I was thinking.
"Robert Bruckner [MSFT]" wrote:
> I suppose you really want the Sum() aggregate, rather than Count(). Count
> works the same way as it works in SQL - every value different than NULL will
> be counted.
> Try this (inside a data region - e.g. in a table header/footer etc.):
> =Sum(IIF( Fields!PDDAYS.Value>30,1,0))
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "SLB" <SLB@.discussions.microsoft.com> wrote in message
> news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> > Hello, I have been fighting with getting the following statement to work
> >
> > =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> >
> > I basically have returned all records to get a total count and need to
> > weed
> > out those I want so I can divide the [totalofallrecords] by the
> > [totalofthose>30daysdue]
> >
> > Any help would be appreciated.
> > Sonja
>
>
=Count(IIF( Fields!PDDAYS.Value>30,1,0))
I basically have returned all records to get a total count and need to weed
out those I want so I can divide the [totalofallrecords] by the
[totalofthose>30daysdue]
Any help would be appreciated.
SonjaI suppose you really want the Sum() aggregate, rather than Count(). Count
works the same way as it works in SQL - every value different than NULL will
be counted.
Try this (inside a data region - e.g. in a table header/footer etc.):
=Sum(IIF( Fields!PDDAYS.Value>30,1,0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"SLB" <SLB@.discussions.microsoft.com> wrote in message
news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> Hello, I have been fighting with getting the following statement to work
> =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> I basically have returned all records to get a total count and need to
> weed
> out those I want so I can divide the [totalofallrecords] by the
> [totalofthose>30daysdue]
> Any help would be appreciated.
> Sonja|||Thanks so much, worked like a charm. Don't know what I was thinking.
"Robert Bruckner [MSFT]" wrote:
> I suppose you really want the Sum() aggregate, rather than Count(). Count
> works the same way as it works in SQL - every value different than NULL will
> be counted.
> Try this (inside a data region - e.g. in a table header/footer etc.):
> =Sum(IIF( Fields!PDDAYS.Value>30,1,0))
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "SLB" <SLB@.discussions.microsoft.com> wrote in message
> news:1D0DCEDA-882C-41E5-9FB7-3308E91DF828@.microsoft.com...
> > Hello, I have been fighting with getting the following statement to work
> >
> > =Count(IIF( Fields!PDDAYS.Value>30,1,0))
> >
> > I basically have returned all records to get a total count and need to
> > weed
> > out those I want so I can divide the [totalofallrecords] by the
> > [totalofthose>30daysdue]
> >
> > Any help would be appreciated.
> > Sonja
>
>
Subscribe to:
Posts (Atom)