gcosta
08-25-2014, 01:58 PM
Complex query
Dear friends, I have the following table:
Table: XY
ID
UD
1
AAA
2
BBB
3
CCC
4
DDD
Does anyone know the SQL expression or query, to get the answer to: "CF" below?
Query
ID
UD
CF
1
AAA
2
BBB
AAA
3
CCC
BBB
4
DDD
CCC
I tried this:
SELECT XY.ID, (DLookUp("[UD]","XY",[ID]=([ID]-"1"))) AS CF, XY.UD
FROM XY;
But it didn't work
Dear friends, I have the following table:
Table: XY
ID
UD
1
AAA
2
BBB
3
CCC
4
DDD
Does anyone know the SQL expression or query, to get the answer to: "CF" below?
Query
ID
UD
CF
1
AAA
2
BBB
AAA
3
CCC
BBB
4
DDD
CCC
I tried this:
SELECT XY.ID, (DLookUp("[UD]","XY",[ID]=([ID]-"1"))) AS CF, XY.UD
FROM XY;
But it didn't work