nealios Posted January 4, 2008 Share Posted January 4, 2008 I have a table that stores expiry dates of gas safety certificates. I want to display all the records that are about to expire, for instance 2 weeks before. So it kind of acts as a reminder system. E.g all the records due to expire 31st january will be displayed from the 16th January. I have looked at the Current_Date function but wasnt sure how to put that into my sql statement. Can any one help? SELECT * FROM Job, customer WHERE Job.cid = customer.cid AND cpexpire < CURRENT_DATE Quote Link to comment https://forums.phpfreaks.com/topic/84477-solved-using-current_date/ Share on other sites More sharing options...
Barand Posted January 4, 2008 Share Posted January 4, 2008 SELECT * FROM Job, customer WHERE Job.cid = customer.cid AND cpexpire BETWEEN CURDATE() AND CURDATE() + INTERVAL 14 DAY Quote Link to comment https://forums.phpfreaks.com/topic/84477-solved-using-current_date/#findComment-430570 Share on other sites More sharing options...
nealios Posted January 4, 2008 Author Share Posted January 4, 2008 Thanks! Works a charm! Quote Link to comment https://forums.phpfreaks.com/topic/84477-solved-using-current_date/#findComment-430588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.