Mysql ADDDATE() or DATE_ADD() with table columns?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-06-16T23:28:04Z Indexed on 2010/06/16 23:32 UTC
Read the original article Hit count: 114

Filed under:
|

How do I do something like the following

SELECT ADDDATE(t_invoice.last_bill_date, INTERVAL t_invoice.interval t_invoice.interval_unit) 
  FROM t_invoice

...where the column t_invoice.last_bill_date is a date, t_invoice.interval is an integer and t_invoice.interval_unit is a string.

Basically, I want to determine a person's next bill date based on his desired billing frequency. Is there a better way to achieve this?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about adddate