Advanced query/filter based on date and values I have a channel of events with a field ‘eventDate’ for the date/time of the event. Within that there are ‘types’ of events ‘eventType’. What would be the most efficient way of outputting the NEXT (future date from now) that is of the ‘eventType’ equal to ‘Green’?

So far i’ve got 

{% for event in craft.entries.section('events').order('eventDate asc') %}


Which will output the entries in the correct order based on the eventDate, but can i filter the query even further to include the conditionals to only output if the date is in the future like this conditional:

{% if event.eventDate|date("c") &gt; now|date('c') %}


And also include the conditional to only output if the eventType == ‘green’ like so:

{% if event.eventType == ‘green’ %}


So that i can set the ‘limit’ to whatever i want and ONLY have the entries that meet the conditionals be included before that limit is applied?

I know that i can use the 'Search' like so:

{% for event in craft.entries.section('events').search('eventType:green').order('eventDate asc') %}


But A. Is that the most efficient and B. How do i also include only entries that are in the FUTURE from NOW based on the eventDate field?
You're actually closer than you might think. All you need to do is add your field handles as parameters. I prefer to use the hash style of declaring parameters but either way will work, I just find this easier to read.

{% set params = {
  section : 'events',
  order : 'eventDate asc',
  eventDate : '&gt;=' ~ now,
  eventType : 'green',
  limit : '10'
} %}

{% for event in craft.entries(params) %}
...
{% endfor %}


This method also allows you to easily modify the params hash for whatever reason. For example you might want to set the eventType value to be something else based on the value of a query parameter. To do that you could use the merge tag like so:

{% if craft.request.getParam('eventType') not empty %}

  {% set params = params | merge({
    eventType : craft.request.getParam('eventType')
  }) %}

{% endif %}