Solved

Want the count number from this QUery

Posted on 2016-09-28
2
48 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Issue with Loop 4 57
ASP Sessions Being Cleared/Modified 6 79
Use a variable for Class Name in Classic ASP 4 55
Select only the top record in a left join 13 34
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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