View Full Version : Count Changes


Grave
03-14-2007, 10:49 PM
Hi, I need to count how many times FarbeBC changed in value.
I don't need how many different values. That would be 4. But it only changed 3 times.


I managed to do this in excel. But can can't find out how to do this in access.

Any help from you guys?

I've Access 2000 with an ODBC connection to an SQL server.

DateEVT | FarbeBC
13/03/2007 06:14:09 | -M7X
13/03/2007 06:16:12 | -M7X
13/03/2007 06:17:12 | -92U
13/03/2007 06:18:35 | -92U
13/03/2007 06:20:53 | -92U
13/03/2007 06:21:57 | -92U
13/03/2007 06:23:00 | -92U
13/03/2007 06:24:31 | -92U
13/03/2007 06:27:24 | -92U
13/03/2007 06:28:43 | -92U
13/03/2007 06:29:47 | -84A
13/03/2007 06:31:09 | -M7X

Frivolous Sam
03-15-2007, 10:57 AM
Try this SQL query:
SELECT COUNT(DISTINCT FarbeBC) FROM Table

Grave
03-15-2007, 10:04 PM
It doesn't do what i want. It gives me the number of different FarbeBC. In this case that would be 3.

Maybe to clear things up a bit

DateEVT | FarbeBC
13/03/2007 06:14:09 | -M7X
13/03/2007 06:16:12 | -M7X
13/03/2007 06:17:12 | -92U ---> This is 1 change
13/03/2007 06:18:35 | -92U
13/03/2007 06:20:53 | -92U
13/03/2007 06:21:57 | -92U
13/03/2007 06:23:00 | -92U
13/03/2007 06:24:31 | -92U
13/03/2007 06:27:24 | -92U
13/03/2007 06:28:43 | -92U
13/03/2007 06:29:47 | -84A ---> This is 2nd change
13/03/2007 06:31:09 | -M7X ---> 3
13/03/2007 06:32:29 | -92U ---> 4
13/03/2007 06:34:43 | -92U
13/03/2007 06:35:47 | -84A ---> 5
13/03/2007 06:36:55 | -84A