All Forums Jobs
kamal-3995 7 posts Joined 03/07
01 Mar 2007
How to use COALESCE fun with date datatype

I have a join of two tables ,where i need to convert null date values to some valid date or a string.How this can done with the COALESCE ?

ANGEL 20 posts Joined 02/05
18 Mar 2007

Hi,COALESCE(Field name , 'Any string or Valid Date')Hope this helpsCheers!!

kamal-3995 7 posts Joined 03/07
19 Mar 2007

But it is not excepting that,it is throughing an error that IF/THEN datatype are not matching.I hav tried with all format.kamal

ANGEL 20 posts Joined 02/05
19 Mar 2007

Try using current_date

kamal-3995 7 posts Joined 03/07
19 Mar 2007

Its wrking with current date , But i wanted to gave exact date there.

dnoeth 4628 posts Joined 11/04
19 Mar 2007

Hi Kamal,date: COALESCE(date_col, date '2007-03-19')string: COALESCE(trim(date_col), 'blabla')Dieter

Dieter

kmallon 2 posts Joined 10/09
12 Oct 2009

That works like a charm. Thanks!

You must sign in to leave a comment.