Update Nulls with Max+1

JLKRK

Registered User.
Local time
Today, 01:36
Joined
Feb 5, 2000
Messages
18
I have a table which records are appended to in batch format. I would like to update a column called batch number for newly appended records with the Max of that column + 1 but I keep getting errors such as "operation must be an updateable query". Anybody have any suggestions. Mind you I am not doing this in VB or SQL formats, I use the query design format. Thanks, Jim
 
Try setting your batch number column on the table as an auto number
It will produce a batch number automatically
 
thanks for the response but...

Thanks Smart, unfortunately I could be appending 50 invoices to the table at once and would like them all to have the same batch number not individual id's (already have that). But I have high hopes you know another way. Thanks, Jim
 
Re update nulls

You can create an append query see below

INSERT INTO Table1 ( batchno )
SELECT Max([batchno])+1 AS batchno1
FROM Table1;

This simply gets the max batch no adds one to it and appends it to the table

You just need to add your invoice fields and roberts your mothers brother
 

Users who are viewing this thread

Back
Top Bottom