Adding 365days or Year in SQL Query - MOODLE
<p>I am trying to create a report where we can see course completion date and the date when it will expire. Here is what I got so far:</p>

<pre><code>SELECT u.firstname AS 'Firstname' , u.lastname AS 'Lastname', cat.name AS 'Organisation', c.fullname AS 'course',
DATE_FORMAT(FROM_UNIXTIME(p.timecompleted),'%Y-%m-%d') AS completed

FROM prefix_course_completions AS p

JOIN prefix_course_categories AS cat 
JOIN prefix_course AS c ON p.course = c.id
JOIN prefix_user AS u ON p.userid = u.id
WHERE c.enablecompletion = 1
ORDER BY u.firstname
</code></pre>

<p>I'm trying to add a new column where 'completed' columns data + 365 = expiration date. I have tried so many methods like DATE_ADD/DATEADD but I still can't get it. Can you please help me. I would appreciate any suggestions and help.</p>

<p>Thanks in advance</p>