Update Query

SteveF

Registered User.
Local time
Today, 11:16
Joined
Jul 13, 2008
Messages
218
Ok, dumb question time again.

I need to make an update query to change 4 fields, three of them will become 'zero' which seems pretty straightforward, but the other one needs to become what I'm replacing with one of the 'zero' figures.

To try and be a litle clearer, my columns are 'opening' 'purchases' 'credits' and 'closing'. My query will, ( theoretically :) ), set 'purchases' credits' and 'closing' to 'zero' whilst moving the figures from 'closing' to 'opening'.

As ever, all help appreciated.
 
You'd need to run two queries i think, the first to transfer the closing to opening and the second to set the other values to zero.
 
So presumably the 'closing' to 'opening' first and then the 'zeros'? Any idea how I move the 'closing' to opening'? That's the bit that has me stumped.
 
Yep thats right, update closing first. The code will be somrthing like below, replacing table1 with your table name and correct field names, copy it into the sql view of a blank query.

Code:
UPDATE Table1 SET Table1.Closing = [Table1].[Opening];
 
Great glad to help

Edit just realised i gave you it the wrong way round, but glad you cracked it.
 

Users who are viewing this thread

Back
Top Bottom