Solved

Want the count number from this QUery

Posted on 2016-09-28
2
54 Views
Last Modified: 2016-09-28
Hi all, I just need the count number from this Query so I can display it.

Set Top10Events=oConn.Execute("SELECT TOP 10 COUNT(a.log_event),a.log_event FROM site_log AS a INNER JOIN events AS b ON a.log_event=b.event_ID WHERE a.log_event<>NULL AND a.log_date BETWEEN #9/29/16&"# AND #6/29/16# AND b.event_start>NOW() GROUP BY a.log_event HAVING COUNT(a.log_event)>0 ORDER BY COUNT(a.log_event) DESC")

Open in new window


Thanks
0
Comment
Question by:Graeme
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 41820480
try

Set Top10Events=oConn.Execute("SELECT TOP 10 COUNT(a.log_event) as eventLogCount,a.log_event FROM site_log AS a INNER JOIN events AS b ON a.log_event=b.event_ID WHERE a.log_event<>NULL AND a.log_date BETWEEN #9/29/16&"# AND #6/29/16# AND b.event_start>NOW() GROUP BY a.log_event HAVING COUNT(a.log_event)>0 ORDER BY COUNT(a.log_event) DESC")
Response.Write Top10Events("eventLogCount")
or
Response.Write Top10Events( 0 )
0
 

Author Closing Comment

by:Graeme
ID: 41820484
Set Top10Events=oConn.Execute("SELECT TOP 10 COUNT(a.log_event) as eventLogCount,a.log_event FROM site_log AS a INNER JOIN events AS b ON a.log_event=b.event_ID WHERE a.log_event<>NULL AND a.log_date BETWEEN #9/29/16&"# AND #6/29/16# AND b.event_start>NOW() GROUP BY a.log_event HAVING COUNT(a.log_event)>0 ORDER BY COUNT(a.log_event) DESC")
Response.Write Top10Events("eventLogCount")

Worked! thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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