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

Update Query

Status
Not open for further replies.

dpaulson

Programmer
May 7, 2000
347
CA
Is there a way to issue an update query that can do simple arithmetic to a value that is in the database?

For example

strSQL = "UPDATE Table SET Field = Field + 1"


David Paulson

 
Yes.

With the example you show, every 'field' value should have 1 added to it. If the value is NULL, it will stay NULL.

As far as I know, that query should work with Access, Microsoft SQL Server, and probably many other databases.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks gmmastros

I could swear that I had already tried that, but I just checked in visdata and it does indeed work.

David Paulson

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top