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 DECODE > > > Hello Listers, > > I need some help please, > I am trying to create a DECODE statement, on a date column and looks > something like this, but does not work. > SELECT COL1, > COL2, > DECODE((SYSDATE - COL_DATE), <= 30, > '30_days', NULL) Days30, > DECODE((SYSDATE - COL_DATE), (between 31 and > 60), '60 Days', > NULL) Days60, > ....... > ....... > FROM ACCOUNT_TBL > WHERE COL = '0' > > Obviously, I have worked out that this can not be done. The > problem is also > that the server is 7.3.4 and I need to use the code in a view. > Does anyone have any solutions/work arounds for this? > Any help will be appraciated. > > TIA > Denham Eva > Oracle DBA > > ______________________________________________________________ > _______________________ > This e-mail message has been scanned for Viruses and Content > and cleared > by MailMarshal > > For more information please visit www.marshalsoftware.com > ______________________________________________________________ > _______________________ > > ############################################################## > ####################### > Note: > This message is for the named person's use only. It may > contain confidential, > proprietary or legally privileged information. No > confidentiality or privilege > is waived or lost by any mistransmission. If you receive > this message in error, > please immediately delete it and all copies of it from your > system, destroy any > hard copies of it and notify the sender. You must not, > directly or indirectly, > use, disclose, distribute, print, or copy any part of this > message if you are not > the intended recipient. TFMC and any of its subsidiaries each reserve > the right to monitor all e-mail communications through its networks. > > Any views expressed in this message are those of the > individual sender, except where > the message states otherwise and the sender is authorized to > state them to be the > views of any such entity. > > Thank You. > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Denham Eva > INET: [EMAIL PROTECTED] > > Fat City Network Services -- 858-538-5051 http://www.fatcity.com > San Diego, California -- Mailing list and web hosting services > --------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). > *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** This e-mail and its attachments are intended for the author's addressee only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e-mail and highlight the error. Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Steps have been taken to ensure this e-mail and attachments are free from any virus, but advise the recipient to ensure they are actually virus free. The views, opinions and judgments expressed in this message are solely those of the author. The message contents have not been reviewed or approved by Iron Mountain. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Lord David INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).