Exclude null text field from query

  • Hi I have a table with a text field: fmtrkno. I want to create a query to exclude all rows with that text field being null. I tried these and they didn't work: where fmtrkno is not null or convert(char(20), fmtrkno) is not null or (CAST(fmtrckno AS char(20)) IS NOT NULL). I also tried the IsEmpty(fmtrkno) but this is not an SQL function. Please help. Thank you

  • This was removed by the editor as SPAM

  • Does something like this not work?

    SELECT * FROM foo WHERE bar IS NOT NULL

    If not, could you provide DDL and some sample data, along with a description of the desired output.

  • Hi,

    There r many ways to remove the null from the tables when u execute sql statement .

    If u want to see the records or insert then u can use something like this.

    Select * from tablename where columnname!=''

     

    Select * from tablename where columnname is not null

    insert into tablename select * from tablename where columnname is not null

     

    from

    sufian

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply