| Author |
Compare Month & year with Current Month & year in Oracle
|
Srinivas Katta
Ranch Hand
Joined: Feb 01, 2007
Posts: 74
|
|
Hi,
I have a requirement where I need to get a Records those are greater than Current month and Year from Oracle Database
For ex:
We have a Column name requested_start_time which will store data like 01-DEC-12 09.00.00.000000000 AM, We need to have all the records that are scheduled in future from current Date
Any help in this regard is highly appreciated
Thanks
Srinivas
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8430
|
|
|
Moving to a more suitable forum...
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Martin Vajsar
Bartender
Joined: Aug 22, 2010
Posts: 2319
|
|
You can use standard relational operators, such as ">", ">=" or "<" with dates.
If you need to round the current date to the start of the month, you could use the trunc function (such as trunc(sysdate, 'MM') -- that would give 2012/11/01 today). However, if you're developing a Java application, you might also perform the date arithmetic in Java, it might be easier (especially with Joda Time library) and more portable.
|
 |
 |
|
|
subject: Compare Month & year with Current Month & year in Oracle
|
|
|