Results 1 to 3 of 3

Thread: Start and End of Month

  1. #1
    Join Date
    Jan 2003
    Location
    UK
    Posts
    55

    Start and End of Month

    I need to create a view that will return data from the start to the end of the given month. I'm not sure how to
    create the 1st of the month and the last day of any given month.

    Thanks in advance.
    Dave.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,557
    Lots of ways. What have you tried on your own so far?

  3. #3
    Join Date
    Jan 2003
    Location
    UK
    Posts
    55
    I'm using the code below, but I'm not sure if it's the most economic way to pick up the dates. I'm used to DateSerial in Access.

    Thanks.

    --Start of Last Month
    select trunc(to_date(add_months(sysdate, -1)), 'MONTH' ) MonthStart from dual;
    --End of Last Month
    select last_day(to_date(add_months(sysdate, -1), 'dd/mm/yy')) MonthEnd from dual;

Posting Permissions

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