Results 1 to 2 of 2

Thread: finding empty data in database

  1. #1
    Join Date
    Nov 2005

    finding empty data in database


    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
    4 3/12/2005
    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
    Hello, one of two should probably work...

    "SELECT ID, Data FROM table WHERE Data = ''"
    "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