Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access Update Query refering to the previous record

Status
Not open for further replies.

ghnat

MIS
Apr 8, 2003
28
CA
Is it possible to update a table's record when a comparison is made from a field in the previous/next record?
For instance, the table is set up like ...

NAME INV_NBR INV_DATE INV_DIF INV_DATE_DIF
----------------------------------------------------
smith 25266 8/10/02 ? ?
jones 25270 8/11/02 ? ?
jackson 25275 8/15/02 ? ?

I would like to "UPDATE" THE 2 columns with ...

(1) invoice number differential in INV_DIF ... 0, 4, 5
(2) invoice date differental in INV_DATE_DIF ... 0, 1, 4

Help!

For the longest time,Ive been exporting out into excel and subsequently importing back into access to acomplish this.

Can it all be done within access??









 
well, it depends. if (and it is a BIG 'if') the records have sufficient identity to ba able to ALWAYS be ordered (e.g. a PK type of field) a sub query can usually do it.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top