Computing.Net > Forums > Programming > SQL Date_Sub function in Informix

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL Date_Sub function in Informix

Reply to Message Icon

Name: skisalomon77
Date: April 1, 2008 at 14:17:37 Pacific
OS: XP Pro
CPU/Ram: Intel - 2GB
Product: Dell Optiplex
Comment:

I'm trying to incorporate the date_sub/subdate function into the below query with an interval of 30 days. Does Informix support this function? Or does it go by another name? I'm using the Informix 3.33 32 bit driver. The below query works fine until I start using date_sub/subdate.

SELECT * FROM informix.table WHERE column < {fn CURDATE()}

Here's the full query, which doesn't work.

SELECT * FROM informix.table WHERE column < {fn DATE_SUB({fn CURDATE()}, INTERVAL 30 DAY)}

Any help would be greatly appreciated!



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: April 1, 2008 at 20:12:42 Pacific
Reply:

First, I'm not familiar the window's version of Informix - just the Unix version. I executed the following query from informix dbaccess:

select * from informix_table where column < today - 30

I'm assuming column is a date type and you are asking for all data less than 30 days ago. today is an internal informix function that returns today's date.



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SQL Date_Sub function in Informix

file handling function in 'C'. www.computing.net/answers/programming/file-handling-function-in-c/2119.html

Function in VB 6 www.computing.net/answers/programming/function-in-vb-6/9626.html

function in C www.computing.net/answers/programming/function-in-c/10023.html