filter by year using date field type

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 2, 2009   (RSS)

By s2smedia - January 2, 2009

I have a newsletter section that i would like to only show newsletters from 2008... and then i have a pull down list that you can view past years newsletters.

Im not sure how to code php to filter certain years.

Im using the date/time field type.. field name is 'date'

thanks in advanced

Re: [s2smedia] filter by year using date field type

By Dave - January 2, 2009

Hi s2smedia,

Try an url like this:
yourViewer.php?date_year=2008

Or a form like this:

<form method="GET" action="/path/to/your/listViewer.php">
<select name="date_year">
<option>2008</option>
<option>2007</option>
<option>2006</option>
</select>
<input type="submit" name="submit" value="Search">
</form>

You can read more on the search docs page:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com