Full Version: counting fields
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
amator
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?
Peter46
SELECT (DateValue(Table.[start time])) AS date, Count(Table.[device ip]) AS events
FROM Table
GROUP BY DateValue(Table.[start time]) ;
amator
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?
Peter46
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.
amator
Yes good point. Now I got it work.
Thanks very much:)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.