Oracle date function [message #424807] |
Tue, 06 October 2009 01:48  |
krishna135
Messages: 3 Registered: September 2009 Location: Chennai
|
Junior Member |
|
|
I need a where clause that will all the records from the previous year and up to todays date.
Since its the first of the year I want all of the data from 1 January 2004. My data set will build until the 31st of December of this year until it resets again on January 1st of next year. Am I clear?
|
|
|
|
|
|
Re: Oracle date function [message #424826 is a reply to message #424807] |
Tue, 06 October 2009 02:49  |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
I'm a bit confused by your question, as the previous year wasn't 2004, it was 2008 (at least it was round here)
If you want to select dates from 1st january last year until the current date, you can useWHERE <date_column> BETWEEN trunc(add_months(sysdate,-12),'YYYY') AND sysdate
|
|
|