A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Date function in Ingres DB
Joined: Feb 23, 2004
Aug 18, 2004 04:54:00
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
date_field is less that 3 months from today.
[ August 18, 2004: Message edited by: Bear Bibeault ]
Joined: Aug 02, 2004
Aug 18, 2004 08:29:00
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:
where date_field < 'today' - '3 months'
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.
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Date function in Ingres DB
finding the closest time in database record
Problem of JDBC request is not supported
jdbc driver loading
accessing database ingres 6.4
HQL date without time
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013