Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Funky date request......
This should work
select decode(to_char(sysdate,'MON'),'FEB',last_day(sysdate -
28),'SEP',last_day(sysdate-30),'JUN',last_day(sysdate-30),
'APR',last_day(sysdate-30),
Do a to_char around last_day if you want a special format.
Debbie Lennartsson
ACP
-----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Christine
Turner
Sent: Monday, July 03, 2000 12:56 PM
To: Multiple recipients of list ORACLE-L
Subject: Funky date request......
Hello All,
My condolences to you if you are working today. As I am too, I know how it feels! Anyway, I have a strange request from one of my users. On an insert statement, they want to be able to insert the current sysdate, minus one month, and make it the last day of that month? Make sense???
IE: current sysdate is July 3, 2000 they would want----> June 30, 2000
Anyone have any ideas how to accomplish this????
TIA
cheers!
Christine Turner
Database Administrator
IPS-Sendero
Scottsdale, Arizona
Phone: (800) 321-6899 ext. 3286
Fax: (480) 946-8224
E-mail: christine.turner_at_ips-sendero.com
-- Author: Christine Turner INET: Christine.Turner_at_IPS-Sendero.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (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).Received on Mon Jul 03 2000 - 11:22:27 CDT