Charlie Mengler wrote: > > I would have thought that the "first day of the month" > is ALWAYS the 1st, as in 1 (ONE)! > > Please explain why it needs to be calculated or > could be a value other than ONE. > > > > > >>> [EMAIL PROTECTED] 01/23/02 10:35AM >>> > > Hey guys, > > > > I know this is propablby easy, but I'm a bit > > overwhelmed here this week. Can you please tell me how > > to get first and last days of the month given SYSDATE? > > > > thanks a lot > > > > Regards > >
Another case of 'On what day does Xmas fall this year? - on December 25th'. I think that using the TRUNC() function with the suitable parameter must help you truncate SYSDATE to the first day of the month - perhaps TRUNC(SYSDATE, 'MM') or similar (too tired to RTFM). Then TO_CHAR with the suitable format should return whatever you want. For the last day, I presume that identifying the first day of the NEXT month and substracting 1 must simplify the 'is this 30/31/28/29' question. -- Regards, Stephane Faroult Oriole Ltd -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: [EMAIL PROTECTED] 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: [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).