Dear readers
I have a simple table with columns ID, Val and prod
Table1
ID val Prod
1 1 A
2 2 B
3 3 A
4 2 B
5 3 A
6 2 B
7 9 A
8 2 B
9 3 B
10 4 A
11 5 A
12 6 B
13 4 B
I would like to query the data in Access to get as result the following table
- filtered by prod = “A”
- Column Val
- 1 extra column with the previous VAL
ID Prod Val Prev
1 A 1
3 A 3 1
5 A 3 3
7 A 9 3
10 A 4 9
11 A 5 4
I am trying to do this with a subquery, but it looks more simple than it is (at least not for me)
Can somebody give me an example?
Many thanks
Ben
I have a simple table with columns ID, Val and prod
Table1
ID val Prod
1 1 A
2 2 B
3 3 A
4 2 B
5 3 A
6 2 B
7 9 A
8 2 B
9 3 B
10 4 A
11 5 A
12 6 B
13 4 B
I would like to query the data in Access to get as result the following table
- filtered by prod = “A”
- Column Val
- 1 extra column with the previous VAL
ID Prod Val Prev
1 A 1
3 A 3 1
5 A 3 3
7 A 9 3
10 A 4 9
11 A 5 4
I am trying to do this with a subquery, but it looks more simple than it is (at least not for me)
Can somebody give me an example?
Many thanks
Ben
Last edited: