www.webdeveloper.com
Results 1 to 2 of 2

Thread: finding empty data in database

  1. #1
    Join Date
    Nov 2005
    Posts
    3

    finding empty data in database

    Hello

    This is my second post here. This is probably one of the most helpful forums out there! =)

    I have a database with perhaps the following:

    ID Data
    1 12/12/2005
    2 5/12/2005
    3
    4 3/12/2005
    5
    6
    7 1/12/2005

    How do I write my SQL statement to retrieve only empty Data?

    SQL="Select ID,Data From table WHERE Data='' " 'does not retrieve anything

    I actually need to count how many blank data there are in the database, and response.write the corresponding ID

    The problem is Data could be an empty string '', it could be null, it could be just blank, we dont know. I dont know what else it could be.

    Anyone done something like this before?

  2. #2
    Join Date
    Jun 2004
    Posts
    390
    Hello, one of two should probably work...

    Code:
    "SELECT ID, Data FROM table WHERE Data = ''"
    
    -OR-
    
    "SELECT ID, Data FROM table WHERE Data IS NULL"
    Whether it is null or a blank string will depend on the column data type and wheter it is set to non-null/required.
    Last edited by schizo; 11-28-2005 at 06:34 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles