I have a CC6 view used to show records from the db, I would like to narrow the records shown by showing only records created in the last year. Having searched the forum I found a snippet of code that I expected to work and modified it.
This is in my where condition
The result it returns is an error message:
gmp is my model name and created is the column name, the column is listed under "Fields to retrieve" but I am still returning the error above. I have cleared the database cache but am now stuck!
Thanks in Advance
Dave
This is in my where condition
<?php
$oneYearAgo = date("Y-m-d H:i:s", strtotime("-1 year"));
$now = date("Y-m-d H:i:s", strtotime("now"));
return array(":gmp.created between $oneYearAgo and $now");
?>
The result it returns is an error message:
1054 - Unknown column ':gmp.created between 2016-08-30 19:34:55 and 2017-08-30 19:34:55' in 'where clause'
gmp is my model name and created is the column name, the column is listed under "Fields to retrieve" but I am still returning the error above. I have cleared the database cache but am now stuck!
Thanks in Advance
Dave