Skip to content
Advertisement

Oracle – Concatenate calculated number field with string field

In this case statement below, I want the result to be a string, either ‘n days’ or ‘n weeks’ based on the conditions in the statement.

How can I concatenate the number generated from ABS(FLOOR(TRUNC(i.schedule_finish) - TRUNC(sysdate))) with a string (that is, ‘ days’ or ‘ weeks’) to generate a string result?

Everything I’ve tried has given me an “inconsistent datatypes” error.

Thanks

Advertisement

Answer

Just use ||:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement