Click to See Complete Forum and Search --> : Adding to an existing value in my database


frank_stain
05-23-2005, 05:55 AM
is there anyway when relating vb.net to access that i can add to a field in the database.

ie totalhours = 48 can i add 3 so totalhours = 51

without using to database accesses one to get the value, then add it in the vb code. then update it again.

is there away this can be done more efficently

A1ien51
05-23-2005, 04:39 PM
Something like this:

UPDATE YourTable
SET fundedYear1 =
(SELECT totalhours + 3 AS Total
FROM YourTable
WHERE (id = '123'))
WHERE (id = '123')


Eric