SQL Statement with null and 0

Results 1 to 2 of 2

Thread: SQL Statement with null and 0

  1. #1
    Join Date
    Dec 1969

    Default SQL Statement with null and 0

    I have part of a SQL statement that will search out records that have a particular field as empty, or containing a 0. It is as follows: <BR><BR>or (trn_emp_course.cs_expire is null) <BR><BR>Now I only want to get fields that have a 0. I have tried <BR><BR>or (trn_emp_course.cs_expire is 0) <BR>or (trn_emp_course.cs_expire = 0) <BR>or (trn_emp_course.cs_expire = &#039;0&#039;) <BR><BR>Can&#039;t get it to work. Any suggestions?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: SQL Statement with null and 0

    what datatype in that column<BR><BR>trn_emp_course.cs_expire = 0 will work if it is a number<BR><BR>an integer field i do not think can ever be empty it will have to be 0 or NULL NOT empty<BR><BR>thi will work for all records where the col is null ot have not value = 0<BR>and (columnName is null OR columnNAme = 0) <BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts