calculate a distinction between two values

bregci

New member
Local time
Today, 22:34
Joined
May 28, 2004
Messages
7
calculate a difference between two values

Hello.
I would like to calculate in querie a difference between two values and I have no idea how to do that.
Please help me.

My querie look's like that.

id_field | id_machine | counter | distinction
----------------------------------------------
....1...........1...............A1................A1......
....3...........1...............B1..............B1-A1....
....4...........1...............C1..............C1-B1....
....2...........2...............A2................A2......
....5...........2...............B2..............B2-A2...
....6...........3...............A3.................A3.....
...10..........3................B3...............B3-A3


Thanks for help
 

Attachments

Last edited:
Do you mean that you want to calculate the difference between successive readings of a counter on a machine? So if the morning reading is 100,the afternoon reading is 300 and the evening reading is 550, you want the query to return 100,200, 250?

Please confirm.
 
cogent1 said:
Do you mean that you want to calculate the difference between successive readings of a counter on a machine? So if the morning reading is 100,the afternoon reading is 300 and the evening reading is 550, you want the query to return 100,200, 250?

Please confirm.


Yes that's right. Do you have any idea how can I solve this problem?
 
You can do it with a series of two queries.

I have attached a database created in Access 2000 (can't open your database in A2K). You can run the second query "qryTwo".

Note
As a subquery is used in the first query, running the queries may take time if the table is large.
 

Attachments

Users who are viewing this thread

Back
Top Bottom