Home » SQL & PL/SQL » SQL & PL/SQL » how to get first day in the date
how to get first day in the date [message #254195] Thu, 26 July 2007 02:27 Go to next message
Messages: 28
Registered: July 2007
Junior Member
how i can get the first day in the date

for example i have this date 22-mar-07 how i can get its first day so the result be like 01-mar-07 please help
Re: how to get first day in the date [message #254198 is a reply to message #254195] Thu, 26 July 2007 02:33 Go to previous message
Michel Cadot
Messages: 63929
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select trunc(sysdate,'MONTH') from dual;

01/07/2007 00:00:00

1 row selected.

Another way is to remember that the first day of the month is always the one with number 1. Wink

Previous Topic: need suggestion with logic
Next Topic: know the @
Goto Forum:

Current Time: Wed Oct 26 18:28:21 CDT 2016

Total time taken to generate the page: 0.08987 seconds