Any function for the first day of the month?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Any function for the first day of the month?

  1. #1
    Join Date
    Mar 2001
    Posts
    286

    Any function for the first day of the month?

    LAST_DAY returns the date of the last day of the month. Any function for the first day of the month? Thanks!

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    trunc(my_date,'MM')

    Have a browse of the SQL Reference manual.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,448
    what is last day + 1??? LOL

  4. #4
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Code:
    SQL> select sysdate from dual;
    
    SYSDATE
    =========
    02-MAY-03
    
    1 row selected.
    
    SQL> select last_day(sysdate)+1 from dual;
    
    LAST_DAY(
    =========
    01-JUN-03
    
    1 row selected.
    
    SQL> select last_day(trunc(sysdate,'MM')-1)+1 from dual;
    
    LAST_DAY(
    =========
    01-MAY-03
    
    1 row selected.
    Sanjay G.
    Oracle Certified Professional 8i, 9i.

    "The degree of normality in a database is inversely proportional to that of its DBA"

  5. #5
    Join Date
    Mar 2001
    Posts
    286
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width