Home » SQL & PL/SQL » SQL & PL/SQL » TRUNC(SYSDATE,'mm')-1 and appending a time
TRUNC(SYSDATE,'mm')-1 and appending a time [message #244440] |
Tue, 12 June 2007 16:50  |
welchaz
Messages: 23 Registered: April 2005 Location: Tucson, AZ
|
Junior Member |
|
|
I'm trying to create a query to select an ending date/time from the previous month as the end range date for selecting records. I have been using "TRUNC(SYSDATE,'mm')-1" which works well for getting the last date of the previous month, but it doesn't include the time portion of the date. I need the time portion to be "23:59:59"...so for example, if I ran the query today (6/12/07), I need the result "31-MAY-2007 23:59:59". I have tried several things, but nothing is working so far.
Any help is appreciated.
|
|
|
|
|
|
Goto Forum:
Current Time: Wed Jul 16 03:12:23 CDT 2025
|