Home » SQL & PL/SQL » SQL & PL/SQL » sql doubt
sql doubt [message #20882] Thu, 27 June 2002 05:59 Go to next message
aruna
Messages: 33
Registered: January 2002
Member
how to retrieve the first day of previous month from the current month plz tell me the query
regards
aruna
Re: sql doubt [message #20884 is a reply to message #20882] Thu, 27 June 2002 06:46 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> ed
Wrote file afiedt.buf

  1* SELECT to_char(TRUNC(TRUNC(SYSDATE,'MONTH')-1,'MONTH'),'day dd,mon,yyyy') FROM DUAL
SQL> /

TO_CHAR(TRUNC(TRUNC(S
---------------------
wednesday 01,may,2002
Re: sql doubt [message #20886 is a reply to message #20882] Thu, 27 June 2002 08:14 Go to previous message
Mark
Messages: 284
Registered: July 1998
Senior Member
SELECT SYSDATE, TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),-1),'DAY MONTH DD,YYYY') "First Day of last Month" FROM DUAL;
Previous Topic: Re: how to uninstall OS
Next Topic: can nested tables increase the performance ?
Goto Forum:
  


Current Time: Fri Apr 19 08:22:44 CDT 2024