NTrade
Computer
- Jan 10, 2007
- 7
Is Access/Jet Table is this:
id, wo,
1, 2345-1
2, 2345-1
3, 2345-1
4, 5432-1
5, 5432-1
6, 5432-1
Need result:
id, wo, parent
1, 2345-1, 1
2, 2345-1, 1
3, 2345-1, 2
4, 5432-1, 4
5, 5432-1, 4
6, 5432-1, 5
the logic is If wo = wo of ID-1 then Parent = Id-1
If wo not= wo of ID-1 then Parent = Id
could use help on the correct sql statement for this...
thanks in advance...
id, wo,
1, 2345-1
2, 2345-1
3, 2345-1
4, 5432-1
5, 5432-1
6, 5432-1
Need result:
id, wo, parent
1, 2345-1, 1
2, 2345-1, 1
3, 2345-1, 2
4, 5432-1, 4
5, 5432-1, 4
6, 5432-1, 5
the logic is If wo = wo of ID-1 then Parent = Id-1
If wo not= wo of ID-1 then Parent = Id
could use help on the correct sql statement for this...
thanks in advance...