I'm having problem constructing below two variables in Access Query or Access SQL which are dependent on each other, please kindly help!
a(n)=b(n)+c(n); b(n)=if(a(n-1)<>0,a(n-1),d(n)).
n refers to the current record while n-1 refers to the previous record.
t1.n = t2.n+1
, in another case enumerate records in the order you need in separate view (statically saved query) and use 2 copies of it.