You can simply compare now () +7 against toexpire.
Daniel
On 10/14/05, Protoculture <[EMAIL PROTECTED]> wrote:
> I need a query that will return all records that are set to expire ( column
> name "toexpire" - which is just a date ) in the next 7 days.
>
> select * from mytable
> where toexpire ?
Mysql has date_add and adddate (and tons more date function) should be
pretty easy.
Check here
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
bookmark it...bookmark it... bookmark it
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Messa
> I need a query that will return all records that are
> set to expire ( column name "toexpire" - which is just
> a date ) in the next 7 days.
> select * from mytable
> where toexpire ???
WHERE toexpire > getdate()
AND toexpire <= DATEADD(dd, 7, getdate())
-Justin Scott
3 matches
Mail list logo