This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Date function in Ingres DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Date function in Ingres DB" Watch "Date function in Ingres DB" New topic
Author

Date function in Ingres DB

Gabriel Tomoloju
Greenhorn

Joined: Feb 23, 2004
Posts: 20
Hello guys,
How do i do i check in my where clause if:
a date_field in a table is less that 3 past months from today.
Note: I am using INGRES DATABASE

select * from tablename
where
date_field is less that 3 months from today.


Thanks.
[ August 18, 2004: Message edited by: Bear Bibeault ]
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hi Gabriel,

It's a long time since I've used Ingres (6 or 7 years!), but if memory serves you can do it with something mad like:

It might be today() without the quotes, however. I'm pretty sure that today - 3 is 3 days ago. Try it.

Anyway, Ingres date stuff is (or was, at least) done using really nasty implicit conversion from strings. It makes the code read OK though.

Hope this helps.

Jules
 
 
subject: Date function in Ingres DB