MySQL Forums
Forum List  »  General

Using values in interval expression ?? [tricky!]
Posted by: Jacques Lorang
Date: September 14, 2006 06:33AM

Hello folks,

I am not shure if this is the right place to put this, if anyone knows
a better place, please let me know.

My problem: Is there any way one could use a field value to set an
intreval expression of a DATE_ADD function in a WEHER clause ?

Example :

SELECT id,sys_interval,sys_date from table WHERE DATE_ADD( sys_date ,
INTERVAL sys_interval ) >= NOW()

So I want to use the value from sys_interval to be used in the DATE_ADD
Interval expression. The values in the sys_interval are strings like "3
month", "1 day" etc..

Any ideas ?

Thanks for any help
Jacques Lorang
Luxembourg,Europe



Edited 1 time(s). Last edit at 09/14/2006 06:42AM by Jacques Lorang.

Options: ReplyQuote


Subject
Written By
Posted
Using values in interval expression ?? [tricky!]
September 14, 2006 06:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.