Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 highest climbers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-19 : 12:58:34
Rene writes "Hi SQL Guru's,

I have a question i am programming a stats counter with asp - sql (wwwl.hotstat.nl). It's working real fine!.

But... i wanna show a top 10 best climbers !

So i need the last to days and the difference between day one and two unique visitors!
for which i use a table with the following fields

customerid (id)
d_date (date)
d_un (unique_visitors)

the query i have so far =
select customerid, max(d_un)-min(d_un) as difference
from dbo_countday
where datediff(d,d_date,current_timestamp) <= 2
group by customerid

which gives a good result but not the - of + (moehahaha)

Of course i can write a long script an loop through the records but i hope you can help me out here to make it work in a simple query!

Greetz,


Rene
r@pn.nl"
   

- Advertisement -