Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Posts
    34

    Unanswered: last day of the next month

    Anyone an idea how to get the last day of the month in timestamp format


    so running the query in May 2015 should return 2015-06-30-23.59.59.999999
    while running the query in June 2015 should return 2015-07-31-23.59.59.999999
    etc .....

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I guess it's the same as "the first day of the next month minus 1 second".
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    try this:
    Code:
    timestamp(current date + 2 month - (day(current date + 2 month)-1) days, 6) - 1 microsecond
    Regards,
    Mark.

Posting Permissions

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