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

How can I update a table for only records that have a blank value?

Status
Not open for further replies.

jazzyjj

IS-IT--Management
Aug 29, 2012
1
US
In other words, I need to skip all records that have a value. In this case, I will only be updating accounts 85 and 92...PLEASE HELP!!

Table - pat

acct group
2 2365
253 66995
41 nkj1236
85
92


 
Depends if the entry is blank - or null. But one of the below....


BLANK


UPDATE
Tablename
SET
[acct group] = VALUEHERE
WHERE
[acct group] is null

NULL

UPDATE
Tablename
SET
[acct group] = VALUEHERE
WHERE
[acct group] is null

Obviously fill in Tablename and VALUEHERE with what you want to update it to.

----------------------------------------

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
[tt]
acct group
--------------
2 2365
253 66995
41 nkj1236
85
92
[/tt]

Code:
UPDATE Table SET Group = 'SomeValue' WHERE ISNULL(Group,'') = ''

Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top