• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compare Month & year with Current Month & year in Oracle

 
Srinivas Katta
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to a more suitable forum...
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic