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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query All Records except for One

Status
Not open for further replies.

eriel3

Programmer
Mar 19, 2004
30
US
Can anyone help? i how do you do an update query in MS ACCESS but I only want to update the all records except for the very first record. So everytime I hit update query it will update all fields except for the first record.
 
You would have to somehow identify record 1 and then using a Where statement in your Update query, eliminate it from the recordset being updated.



Hope this helps.

OnTheFly
 
Okay, I kind of figured that part out, but I am not really a programmer so I do not know exactly how to tell it to exclude. I do have an Unique ID Field that can do be the identifier, could you tell me what to write to exclude.


Here is my SQL:
UPDATE [Daily Activity-Millennium] SET [Daily Activity-Millennium].AVAILABLE_INV = (DLookUp("[AVAILABLE_INV]","Daily Activity-Millennium","[DailyID]=" & [DailyID]-1))+[MEOH_MILLEN]-[TOTAL_TAKE];
 
How about....

UPDATE [Daily Activity-Millennium] SET [Daily Activity-Millennium].AVAILABLE_INV = (DLookUp("[AVAILABLE_INV]","Daily Activity-Millennium","[DailyID]=" & [DailyID]-1))+[MEOH_MILLEN]-[TOTAL_TAKE] WHERE UniqueID <> 1



Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top