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!

SELECT WHERE field IS NULL not working

Status
Not open for further replies.

MamaLoca

Programmer
Aug 29, 2005
48
I have been monkeying with this for while now. I want to select all the records where a specific field is empty

SELECT * FROM `maps` WHERE `description` IS NULL

It's not working and I'm not sure why. I know the records are there cause I can call them with SELECT * FROM `maps`, and I know there are empty fields but try as I might I can not get this to work. No errors just a lot of empty space where the records should be displayed

Nila __________________________________________________________________
Life would be so much easier if I only had the source code.
 
Are you sure the fields are NULL - or do they contain an empty string? or even just whitespace? Try:

Code:
SELECT * FROM `maps` WHERE TRIM(`description`) =''

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top