RE: DECODE or not to DECODE

2003-08-14 Thread Denham Eva
Thanks To all for the support! I managed to use a combination of thesuggestions which worked great! Denham -Original Message- Sent: Monday, August 04, 2003 4:24 PM To: Multiple recipients of list ORACLE-L Hello Listers, I need some help please, I am trying to create a DECODE

RE: DECODE or not to DECODE

2003-08-04 Thread Lord David
One trick is to use the sign() function... decode(sign(30 - sysdate + col_date), 1, '30_days', NULL), Regards David Lord -Original Message- From: Denham Eva [mailto:[EMAIL PROTECTED] Sent: 04 August 2003 15:24 To: Multiple recipients of list ORACLE-L Subject: DECODE or not to

Re: DECODE or not to DECODE

2003-08-04 Thread Jonathan Gennick
One possibility that comes to mind is to write a really, really long DECODE: DECODE((SYSDATE - COL_DATE), 1, '30_days', 2, '30_days', 3, '30_days', ... NULL) Days30 But there must be a better possibility. Perhaps use the SIGN function: DECODE ( SIGN((SYSDATE - COL_DATE)-30), -1,

RE: DECODE or not to DECODE

2003-08-04 Thread Carol Bristow
Eva - I dredged this out of some ancient code that I wrote against a 7.2 database. The inner trunc functions were there to get rid of the time - I don't remember why the outer trunc function was there at this point (it was five years ago). This doesn't get you completely there, but will

RE: DECODE or not to DECODE

2003-08-04 Thread Lord David
] Sent: 04 August 2003 15:39 To: Multiple recipients of list ORACLE-L Subject: RE: DECODE or not to DECODE One trick is to use the sign() function... decode(sign(30 - sysdate + col_date), 1, '30_days', NULL), Regards David Lord -Original Message- From: Denham Eva [mailto