Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2008, 07:14 PM
Friend of Wrox
Points: 630, Level: 9
Points: 630, Level: 9 Points: 630, Level: 9 Points: 630, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Austin, TX, USA.
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default Select errors on Count() w/ rollup for a datagrid

I have the following coding to report the 'Totals' for different TransCode.

strApptsSQL = "SELECT c.LName + ', ' + c.FName AS Examiner, " & _
"COUNT(Case TransCode WHEN 'R' THEN 1 ELSE NULL END) AS Requested, " & _
"COUNT(Case TransCode WHEN 'B' THEN 1 ELSE NULL END) AS Scheduled, " & _
.....
"FROM MyProgram.dbo.TransHistory AS T " & _
"LEFT JOIN MyWebServer.MyProgram.dbo.Requests AS r ON T.TransUserID = r.RequestStaffIDFK " & " " & _
"LEFT JOIN MyWebServer.MyProgram.dbo.Contacts AS c ON r.RequestStaffIDFK = c.ContactPK " & " " & _
"GROUP BY c.LName + ', ' + c.FName WITH ROLLUP " & _
"ORDER BY c.LName + ', ' + c.FName"


I created 2 requests for Name1 and 5 requests for Name2; then scheduled 2 requests and completed 1 for Name2.
Here is what the ReportTotals showed. Requests: 4=2x2, 25=5x5; Scheduled:10=2x5; and Completed:5=1x5. The first row showed '0'.
Why? What's wrong with the 'Rollup'?

           Request Scheduled Completed
            0 0 0
            29 10 5
Name1 4 0 0
Name2 25 10 5
__________________
C. Jeffrey Wang




Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom paging in Datagrid with datagrid page count madhusrp ASP.NET 1.0 and 1.1 Professional 12 June 2nd, 2008 01:15 PM
Select COUNT(*) grstad Classic ASP Basics 5 April 28th, 2006 11:01 AM
SELECT COUNT as a ROW?? t0ny SQL Language 3 December 8th, 2004 05:31 AM
Select Where Greater Than Count dave.cody@accenture.com SQL Language 3 April 29th, 2004 05:14 AM
How to execute SELECT count(*) lxu Access 2 April 8th, 2004 08:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.