UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> counting fields    
 
   
amator
post Aug 29 2006, 04:02 AM
Post #1

UtterAccess Addict
Posts: 157



Hi
I asked in this forum previously how to count how many events has happened in every day. I got an answer which solves it almoust. But I still haven't solve my problem. So I have a table which looks like this
[start time] [end time] [device ip]
11.12 10:10 11.12 10:11 111
11.12 10:10 11.12 10:13 113
12.12 12:33 12.12 12:34 222
..
So you help me to make query. I make query like this:
SELECT (DateValue(Table.[start time])) AS date, Count(Table.[device ip]) AS events
FROM Table
GROUP BY Table.[start time], Table.[device ip];
And this query make this kind of table
date events
11.12 1
11.12 1
12.12 3
But I want to make query which calculates faults togethet which has happened in same day. Like this:
date events
11.12 2
12.12 3
So how I have change my query or do I have to make another query? Or do I have to make somekind of WHERE statement?
Go to the top of the page
 
+
Peter46
post Aug 29 2006, 05:30 AM
Post #2

UtterAccess VIP
Posts: 7,397
From: Oadby Leics, UK



SELECT (DateValue(Table.[start time])) AS date, Count(Table.[device ip]) AS events
FROM Table
GROUP BY DateValue(Table.[start time]) ;
Go to the top of the page
 
+
amator
post Aug 29 2006, 05:38 AM
Post #3

UtterAccess Addict
Posts: 157



Thanks.
But it still doesen't work perfect. Now the query looks like this:
date events
28.3 3
28.3 121
28.3 4
29.3 1
29.3 20
So it now counts together something from same date but not everything. Why? What might be now wrong?
Go to the top of the page
 
+
Peter46
post Aug 29 2006, 05:43 AM
Post #4

UtterAccess VIP
Posts: 7,397
From: Oadby Leics, UK



Do your dates cover more than one year? If so you will get one entry for each date for each year.

Please post the SQL you are actually using.
Go to the top of the page
 
+
amator
post Aug 29 2006, 05:46 AM
Post #5

UtterAccess Addict
Posts: 157



Yes good point. Now I got it work.
Thanks very much:)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 04:48 PM