Solved

Want the count number from this QUery

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

Accepted Solution

by:
Big Monty earned 500 total points
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now