Ignores null values !!!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Ignores null values !!!

  1. #1
    Join Date
    Jun 2004
    Posts
    288

    Ignores null values !!!

    I have a datafield with values "ABC", " ", and NULL.

    When I query value <> "ABC", it retrieves " ", but ignores the null values.

    Is there any settings to be done on Database property so that the query will also include null values?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    What kind of database?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2003
    Posts
    2,750
    It would probably help to see your SQL statement but I will take a stab:

    ...AND datafield IS NULL

    Typically any comparison, other than the format above, against a NULL value will result in a False result.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  4. #4
    Join Date
    Jun 2004
    Posts
    288

    SQL 2000 Query

    Quote Originally Posted by Phil Weber
    What kind of database?
    Phil,

    It is SQL 2000.

    Thanks.

  5. #5
    Join Date
    Apr 2005
    Posts
    3
    Hi. You can use the ISNULL function.

    For example, isnull(value, 0) will return zeros where value is equal to null. Just remember what you set your nulls to so you can interpret you results correctly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center