Re: [Hsqldb-developers] Concatenating fields

2006-06-23 Thread Nitin Uchil
Thanks John:   IFNULL works fine with non DATES but for dates I have to do IFNULL(TO_CHAR(date_field,'MM/DD/','')   Do you know why?   However it works great for expressions like:   IFNULL('-'||field4,'') Here I am trying to add the 4 digit zip code extension for US addresses and when some of t

Re: [Hsqldb-developers] Concatenating fields

2006-06-22 Thread John Yeary
Try using the following function.IFNULL(exp,value)if exp is null, value is returned else exp) - use COALESCE() insteadOn 6/22/06, Nitin Uchil <[EMAIL PROTECTED]> wrote: If I concatenate 2 fields:   SELECT field1||'-'||field2 FROM table1,   I get NULL if one of the fields is NULL.   Is

[Hsqldb-developers] Concatenating fields

2006-06-22 Thread Nitin Uchil
If I concatenate 2 fields:   SELECT field1||'-'||field2 FROM table1,   I get NULL if one of the fields is NULL.   Is this normal? How can I blank NULL fields on SELECT so that on concatenation, I see the ones that are defined?   I cannot do this in the database because some of them are foreign