Hi,
I need to display a list of names per year for a four-year period, starting at whatever the current year is.
I tried the following but this returned every year in the database from 2004 to 2024.
$thisyear = DATE('Y');
$futuredate = DATE('Y') +4;
list($storm_namesRecords, $storm_namesMetaData) = getRecords(array(
'tableName' => 'storm_names',
'loadUploads' => true,
'allowSearch' => false,
'where' => 'storm_year >= "'.$date.'"' and 'storm_year <= "'.$futuredate.'"',
'orderBy' => 'storm_year ASC, storm_name ASC',
));
I then tried the following which returns 2020 - 2023. If I change the 'futuredate' to +5 years, it does the trick but I am wondering what is the correct syntax?
$thisyear = DATE('Y');
$futuredate = DATE('Y') +4;
list($storm_namesRecords, $storm_namesMetaData) = getRecords(array(
'tableName' => 'storm_names',
'loadUploads' => true,
'allowSearch' => false,
'where' => "storm_year BETWEEN '$thisyear' AND '$futuredate'",
'orderBy' => 'storm_year ASC, storm_name ASC',
));
Thanks
Terry