Tags: column, convert, database, date, datefield, db2, field, inmy, mysql, null, oracle, returns, spaces, sql, string
Convert Null in Date field to String
My SQL returns a NULL in a datefield if there is no date in that field.
If there is a NULL in this column, I want to replace it with spaces in
my SELECT statement when I am selecting these records. Can any of you
experts out there help me with a sample SQL.
Leave a comment...
- 10 Comments
- SELECT COALESCE(VARCHAR(datefield), '') FROM X...Quote:#1; Fri, 04 Jan 2008 09:48:00 GMT
- Thank you. I was trying the coalesce but did not cast it to VARCHAR.
I really appreciate your help. It works now.
Have a good day !
- My pleasure. Glad it worked!