Saturday, March 24, 2012

summary dilemma

hey all,
i was wondering how you would do this.
i have a webform with a summary page on it. The summary page tells you the
followng:
# of Employees Unchanged
# of Employees Underwriting
# of Employees Approved
On the bottom of the summary table is a grid of employees. initially, i load
all employees for a particular department the viewer belongs to. if the
viewer is an admin the summary table will reflect all employees in all
departments.
the way i have it now is if the viewer is an admin i go ahead and get all
the employees in all departments and load into a dataset. what if there were
8,000? would this be the most efficient way to get the summary table updated
?
my opinion is no but not sure of any other way to do it.
thanks,
rodcharFor the summary table I would use aggregate functions in the SQL
I'm assuming approved and underwriting are bit fields
SELECT SUM(CASE WHEN underwriting = 0 THEN 0 ELSE 1 END) AS
underwritingTotal,
SUM(CASE WHEN approved= 0 THEN 0 ELSE 1 END) AS approvedTotal
FROM employee
Thats the quickest way to do the summary. You probably won't want to show
all 8000 employees on the one page (maybe a paged GridView)
Jon
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:AD0F63A5-9AA2-41CA-A096-CF5795631BD3@.microsoft.com...
> hey all,
> i was wondering how you would do this.
> i have a webform with a summary page on it. The summary page tells you the
> followng:
> # of Employees Unchanged
> # of Employees Underwriting
> # of Employees Approved
> On the bottom of the summary table is a grid of employees. initially, i
> load
> all employees for a particular department the viewer belongs to. if the
> viewer is an admin the summary table will reflect all employees in all
> departments.
> the way i have it now is if the viewer is an admin i go ahead and get all
> the employees in all departments and load into a dataset. what if there
> were
> 8,000? would this be the most efficient way to get the summary table
> updated?
> my opinion is no but not sure of any other way to do it.
> thanks,
> rodchar
thank you that makes sense.
"Jon" wrote:

> For the summary table I would use aggregate functions in the SQL
> I'm assuming approved and underwriting are bit fields
> SELECT SUM(CASE WHEN underwriting = 0 THEN 0 ELSE 1 END) AS
> underwritingTotal,
> SUM(CASE WHEN approved= 0 THEN 0 ELSE 1 END) AS approvedTotal
> FROM employee
> Thats the quickest way to do the summary. You probably won't want to show
> all 8000 employees on the one page (maybe a paged GridView)
> Jon
> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:AD0F63A5-9AA2-41CA-A096-CF5795631BD3@.microsoft.com...
>
>

0 comments:

Post a Comment