Query using date_add and date_format
Posted: Tue Nov 06, 2012 3:06 pm
Hi
Am building an invoicing system in a small sporting associations website.
Have this query, it works fine.
SELECT date_format( inv_date, '%b %e, %Y' ) AS issuedate, DATE_ADD( inv_date, INTERVAL 14 DAY ) AS duedate, inv_id, inv_date
FROM inv_to
inv_date is a DATE column in the table.
What I would like to do is put these 2 parts of the query together so I have a "Due Date" 14 days after the "Issue Date" that is reformatted
"date_format( inv_date, '%b %e, %Y' ) --------DATE_ADD( inv_date, INTERVAL 14 DAY ) AS duedate
Hope this makes sense.
As always, thanks in advance for any assistance you can offer
Am building an invoicing system in a small sporting associations website.
Have this query, it works fine.
SELECT date_format( inv_date, '%b %e, %Y' ) AS issuedate, DATE_ADD( inv_date, INTERVAL 14 DAY ) AS duedate, inv_id, inv_date
FROM inv_to
inv_date is a DATE column in the table.
What I would like to do is put these 2 parts of the query together so I have a "Due Date" 14 days after the "Issue Date" that is reformatted
"date_format( inv_date, '%b %e, %Y' ) --------DATE_ADD( inv_date, INTERVAL 14 DAY ) AS duedate
Hope this makes sense.
As always, thanks in advance for any assistance you can offer