count in a recordset

count in a recordset

Post by Anders Nilsso » Fri, 18 Jan 2002 19:22:13



Hi.
I made a page hitcounter, and when i want to show the result on my Adminpage
i get a result like this.
Date and time, IP number.

What i would like to get is:
Date total hits
Date and time, IP number

How can i make a SQL query to get this answer?

/Anders

 
 
 

count in a recordset

Post by Gerry Whit » Fri, 18 Jan 2002 21:47:33


which DB - I mean if its access, do it in access....

GROUP BY functionality!

I think Toms got some demos of grouping - webuality.com

--
http://dergal.com

Hosting
E-Commerce
Web based Apps & More
Tel  UK 0870 757 1645

Quote:> Hi.
> I made a page hitcounter, and when i want to show the result on my
Adminpage
> i get a result like this.
> Date and time, IP number.

> What i would like to get is:
> Date total hits
> Date and time, IP number

> How can i make a SQL query to get this answer?

> /Anders


 
 
 

count in a recordset

Post by Anders Nilsso » Fri, 18 Jan 2002 22:08:51


I use Access DB and it looks like this.

DB_ID,         DB_Datum,                    DB_IPnummer
72                  2002-01-14 16:39:43        127.0.0.1

And what i would like the query to pick out is.

Date total hits/day
Date and time, IP number

Any suggestion how this query could look like?

/Anders



Quote:> Hi.
> I made a page hitcounter, and when i want to show the result on my
Adminpage
> i get a result like this.
> Date and time, IP number.

> What i would like to get is:
> Date total hits
> Date and time, IP number

> How can i make a SQL query to get this answer?

> /Anders

 
 
 

count in a recordset

Post by StoreFront Suppor » Fri, 18 Jan 2002 23:37:28


SELECT Count IP  as totalhits from yourtable

Total Sessions = <%= totalhits %>

SELECT COUNT DISTINCT IP as totaluniquehits from your table.

I don't know it the Distinct on Count will work or not but generally this is
what you want to accomplish.  count will get you the total number of rows or
entries. Distinct will get you the total number of rows with a unique IP.

Bob
StoreFront E-Commerce for Dreamweaver and UltraDev
www.storefront.net

Total Unique Visitors = <%= totaluniquehits %>

Quote:> Hi.
> I made a page hitcounter, and when i want to show the result on my
Adminpage
> i get a result like this.
> Date and time, IP number.

> What i would like to get is:
> Date total hits
> Date and time, IP number

> How can i make a SQL query to get this answer?

> /Anders

 
 
 

1. Optimizing Count() on Large Recordset -- Looking For Insight

I'm wondering if anyone knows a better way to streamline this.  I have a messageboard that has about 60,000 posts.  I've noticed that within the last 2 months, the board has gotten slower and slower... so I've decreased the number of posts (by days) that it shows... however, the performance is still chugging.  It didn't used to to max out my CPU (on SQL Server) but now it does.  Anyways, my code is attached.  The one query that absolutely wrecks havoc (believe it or not) is the "getcount" query.  If I leave that out, the page cooks.  With it in, it gets cooked. :)  I really don't want to delete some of the old posts, but if I have to, I will.

Your thoughts are greatly appreciated!

Sincerely,
Ray

2. Can U C this????????

3. Total count recordset

4. DW hit counter command?

5. Recordset COUNT value

6. probably a VFAQ: how to play continuous music within different dir's

7. Repeating recordset using COUNT??

8. Problems with set DBuser attribute(Urgent)

9. Count Count Count

10. Total Book Word Count, Page Count, Figure/Graphics Count, etc.

11. count() to count words, lines, etc

12. Word Count and Page Count, how do I ...?

13. Record Count to count number of fields?