I want to get the list of documents that needs to be renewed. The documents expire and needs renewal annually. I want to be alerted 4 months to expiry. I don't know the logic am missing here;
Array for column sorting
$aColumns = array('ps_id', 'ssc_number', 'submission_type', 'seru', 'jootrh', 'kppb', 'cdc','csc', 'status', 'audit_status', 'comments', 'systemtime','username');
$aResultColumns = array('ps_id','ssc_number', 'submission_type', 'seru', 'jootrh', 'kppb', 'cdc',
'csc', 'status', 'audit_status', 'comments', 'systemtime', 'username');
Column for indexing and cardinality
$sIndexColumn = "ps_id";
//Table to query
$sTable = "protocol_submissions";
Here's the query. seru is a date variable returned and I want the documents that will expire in 270 days, that is when todays' date is greater that 'seru date+270days'
$sQuery = "SELECT SQL_CALC_FOUND_ROWS " . str_replace(" , ", " ", implode(", ", $aResultColumns)) . "
FROM $sTable
$sWhere WHERE date('m/d/Y', seru +270days) > date('m/d/Y')
$sOrder
$sLimit
";