Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- General Development
- :
- Filter Empty Strings (Not Null) in SOQL.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Filter Empty Strings (Not Null) in SOQL.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-11-2008 10:46 AM
Here is the setup.
Some_Field__c is a Text length 20.
Some_Field__c is not null
This is proven by running
SELECT Some_Field__c FROM Account WHERE Id ='0013000000Ik1srAAB' and Some_Field__c !=null
and it returns the row.
And
SELECT Some_Field__c FROM Account WHERE Id ='0013000000Ik1srAAB' and Some_Field__c = null
does not return a row.
The row is an empty string but
SELECT Some_Field__c FROM Account WHERE Id ='0013000000Ik1srAAB' and Some_Field__c = ''
doesnt return anything.
Also,
SELECT Some_Field__c FROM Account WHERE Id ='0013000000Ik1srAAB' and Some_Field__c = '%'
doesn't return anything.
This is happening on a summer 08 sandbox org.
How do I filter on the empty string?
Re: Filter Empty Strings (Not Null) in SOQL.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-16-2008 02:20 PM
http://ideas.salesforce.com/article/show/10093853
Re: Filter Empty Strings (Not Null) in SOQL.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-18-2013 08:58 AM
Try this...
FROM Account WHERE FieldName != null
This works: != null
When i used the Add Condition in data loader, I tried Operation of "not equals" and a value of Null and it retuned:
FROM Account WHERE AccountNumber != 'Null'
The 'Null' is looking for a value of the work Null... so no good.
When i use the Add Condition in data loader, and try Operation of "not equals" and i leave the Value empty, it returns:
FROM Account WHERE AccountNumber != ''
The != '' works as well.

