calculate a distinction between two values (1 Viewer)

bregci

New member
Local time
Today, 02:53
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

  • engl.zip
    13.1 KB · Views: 113
Last edited:

cogent1

Registered User.
Local time
Today, 01:53
Joined
May 20, 2002
Messages
315
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.
 

bregci

New member
Local time
Today, 02:53
Joined
May 28, 2004
Messages
7
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?
 

Jon K

Registered User.
Local time
Today, 01:53
Joined
May 22, 2002
Messages
2,209
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

  • Calculate difference between two records Access 2000.zip
    14.3 KB · Views: 139
  • Calculate difference between two records Access 97.zip
    6.2 KB · Views: 109

Users who are viewing this thread

Top Bottom