Can someone help me out? I'm new to MS Access and SQL so, I have now to solve a problem but I do not know how.
Because of that I had to post my problem on this forum and I might get a solution for it. And here is: how could I refer to a certain row (number) using SQL. (I have to tell that I solved this problem but in and with FoxPro but not with SQL). Shortly, how coul I refer the previous row data from a certain field to the next one. Thank you very much,
The basic answer is, you can't. There are no "current row/previous row" operators or methods in SQL.
A relational database isn't a flat file system, you aren't "iterating" through the rows one at a time. It is operating on them in a "set" operation system.
If you *must* iterate through the rows and keep track of the contents of the previous rows, you must write VBA, instantiate a recordset (aka "Cursor"), iterate through it using the recordset methods (.MoveFirst, .MoveNext, etc.); and then use the recordset to populate a report or a update a table to keep track of the results.