SYSDATE as key

Hi, trying to get the following syntax right in DI but struggling, any help appreciated, thanks.

(on ORACLE 10)

would like to see SYSDATE()-1 as a key e.g. 20091115 (decimal field)

any ideas, thanks.


mjs8274 :uk: (BOB member since 2006-04-26)

to_char(sysdate(), 'YYYYMMDD')

You will get a warning message that you are assigning a char to a decimal but that’s fine, values like 20091115 can be converted implicitly. If you want to gt rid of the warning message put it inside a cast function.

cast(to_char(sysdate(), 'YYYYMMDD'), 'decimal(8,0)')

Werner Daehn :de: (BOB member since 2004-12-17)

nice, thank you!


mjs8274 :uk: (BOB member since 2006-04-26)