summary dilemma

G

Guest

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
 
J

Jon

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
 
G

Guest

thank you that makes sense.

Jon said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top