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

Delete <NULL> fields

Status
Not open for further replies.

JohnKIT05

Technical User
Feb 18, 2005
19
US
Few of my databases has records of <Null> data in the fieldnames. I tried several ways of writing a code to delete those records but it will say '0 records affected'.

Here is an example of my code to delete the records with the <NULL> data:

USE PurchTransf
DELETE FROM Whse2Data
WHERE UnitsMTD = Null and AUGunits = Null and
DECunits = Null and FEBunits = Null

John
 
hi,
null relationships are "is" null not "=" null also unless you want all four columns to be null you need or statements

try

DELETE FROM Whse2Data
WHERE UnitsMTD is Null or AUGunits is Null or
DECunits is Null or FEBunits is Null

HTH

Bassguy
 
Hey bassguy and Sheco,

You both are right. I happens to find the answer while I was searching the index in the help of the SQL Analyzer when you both replied. That was the answer.

Thanks,
John

Hey bassguy I play guitar too. Keep rockin!!!

 
at least you didn't ask what kind of bass i fish

bassguy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top