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
hussienburhan
Messages: 28
Registered: July 2007
Junior Member
hi
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: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select trunc(sysdate,'MONTH') from dual;

TRUNC(SYSDATE,'MONT
-------------------
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

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


Current Time: Sun Dec 11 00:35:12 CST 2016

Total time taken to generate the page: 0.03584 seconds