How to count visitors on my page per month?

Results 1 to 2 of 2

Thread: How to count visitors on my page per month?

  1. #1
    Join Date
    Dec 1969

    Default How to count visitors on my page per month?

    hello, In my access database I have a table alled "Visitor_Log", this has two fields, the "ID" which is in autonumber format and "Date" which is in date/time format Now I would like to SELECT and count the visitors I have had per month so it is summarized like below: <BR><BR>Dec 2001 - 218 hits <BR>Jan 2002 - 350 hits <BR>Feb 2002 - 325 hits <BR>Mar 2002 - 278 hits <BR><BR>and so on ... <BR><BR>How do I do that SELECT phrase?? <BR><BR>I have done the following at the moment.. but something is wrong :(<BR>____________________________________________ ___________________<BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)<BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.<BR>/admin/countersum.asp, line 46<BR>____________________________________________ ___________________<BR><BR>My code:<BR>set conn=server.createobject("adodb.connection") <BR>datasource="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../logg.mdb") <BR> Conn.Open datasource,, <BR><BR>sqltemp="Select Count(*) As Antal FROM Visitor_Log" <BR>set rs=conn.execute(sqltemp) <BR><BR>sqltemp2="SELECT MONTH([Date]) as TheMonth, COUNT(Visitor_ID) as TheCount FROM Visitor_Log GROUP BY MONTH([Date])" <BR>set rs2=conn.execute(sqltemp2) <BR><BR><BR>%&#062; <BR><BR>Total hits: <BR> &#060;%Do Until rs.EOF%&#062; <BR> &#060;%=rs("Antal")%&#062; <BR> &#060;% <BR> rs.MoveNext <BR> Loop <BR> rs.close <BR> %&#062; <BR> <BR>By month: <BR>&#060;%Do Until rs2.EOF%&#062; <BR> &#060;%= rs("theMonth") %&#062; <BR><BR>&#060;% <BR>rs2.MoveNext <BR>Loop <BR>rs2.close <BR>%&#062;<BR><BR>_______________________________ ________________________________<BR>many thanks, <BR>david

  2. #2
    Join Date
    Dec 1969

    Default RE: How to count visitors on my page per month?

    I rember this from yesterday...<BR><BR>1) What is line 46?<BR><BR>2) What happens if you execute the query in sqltemp2 directly in the querydesign view in Access?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts