On 4/11/02, Thomas Testmann penned:
>I have a counter on my website, which stores in a table, named 'Visitors',
>with the following fields:
>
>[Section],[Page],[Browser],[Country],[Date],[Time],[Year],[Month],[Week],[Da
>y],[Referent],[IP]

Unfortunately, you can't use DISTINCT in an aggregate function with Access.

COUNT(Distinct IP) as Unique_IP

Works with most DBMS databases, but not Access.

A workaround is to use something in your code. This works with 
ColdFusion by grouping on the output. I presume you can probably do 
something similar with whatever you're using.

SELECT DISTINCT Week, IP
FROM Visitors
ORDER BY Week

Week-IPs<br>
<CFOUTPUT query="getvisitors" group="week"><cfset IPs = 0>
<CFOUTPUT><cfset IPs = IPs + 1></CFOUTPUT>
#week# - #IPs#<br>
</CFOUTPUT>

Will return something similar to:

Week-IPs
1 - 200
2 - 400
3 - 100
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452

Please visit http://www.ipswitch.com/support/mailing-lists.html 
to be removed from this list.

An Archive of this list is available at:
http://www.mail-archive.com/imail_forum%40list.ipswitch.com/

Please visit the Knowledge Base for answers to frequently asked
questions:  http://www.ipswitch.com/support/IMail/

Reply via email to