Solved

recotd count is 0

Posted on 2004-04-27
6
224 Views
Last Modified: 2012-05-04
How can i show  0 count
if EmpCount = 0

My query skips if count is 0

sql = "SELECT count([Devlopment].empid) As EmpCount,[Course Titles].Title,[Course Titles].Title FROM [Course Titles] INNER JOIN Devlopment ON [Course Titles].ID = Devlopment.TitleID WHERE Devlopment.plan=True group by [Course Titles].Title"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
   do while not re.eof

example

Titles   EmpCount
  35      3
  10      0
  17      1

0
Comment
Question by:alberte
6 Comments
 
LVL 12

Expert Comment

by:ill
ID: 10929063
sql = "SELECT count([Devlopment].empid) As EmpCount,[Course Titles].Title,[Course Titles].Title FROM [Course Titles] LEFT JOIN Devlopment ON [Course Titles].ID = Devlopment.TitleID WHERE Devlopment.plan=True group by [Course Titles].Title"
0
 

Author Comment

by:alberte
ID: 10929172
I got
Syntax error in JOIN operation.

/school/media/admin/planned/planned.asp, line 36
0
 
LVL 6

Accepted Solution

by:
Lord_McFly earned 50 total points
ID: 10929490
SELECT COUNT([Development].empid) AS EmpCount, [Course Titles].Title
FROM [Course Titles] LEFT OUTER JOIN Development ON Development.TitleID = [Course Titles].ID
WHERE Development.plan = True
GROUP BY [Course Titles].Title
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IIS 7 and executing pages using localhost 16 24
Html split(text) 2 27
Building JSON Results Table FROM DB 9 32
JS to redirect to prev page 8 18
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question