user1114312
user1114312

Reputation:

Update column in Access using query in VB.Net

I need to update a column by adding a value in Access:

update table1 set column1 = column1+value

In the above, if column1 is null, then the table is not updated.

I need a function like in SQL Server:

update table1 set column1 = isnull(column1,0) + value

Upvotes: 0

Views: 1064

Answers (2)

Nighil
Nighil

Reputation: 4129

i think there is no option for it in query if you are using Access as database (Backend)

Upvotes: 0

Fionnuala
Fionnuala

Reputation: 91316

You do not give a data type for column1. The string concatenator is & not +, so consider:

UPDATE Table1  
SET Table1.AText = [AText] & "A", 
    Table1.ANumber = Nz([ANumber],0)+1;

In both these examples, the column (field) will be updated even if it is null.

Upvotes: 1

Related Questions