Query for multiple date ranges on a date field I'm able to successfully query a date field for a date range using this syntax:
{% set entries = entries.startsOn(['and', '&gt;= '~firstDay, '&lt; '~ lastDay]) %}

What I would like to do however is query that field for multiple date ranges at once with an or operator.
I can do this with other fields but the date range already using an and operator complicates matters so I can't do the same.
{% set data = data|merge(['or']) %}
{% for item in items %}
     {% set data = data|merge(['*'~item~'*']) %}
{% endfor %}

Any suggestions gratefully received!
You can use two queries, each for each range, and then merge them like this:
{% set firstRange = craft.entries({fieldHandle: ['and', '&gt;= '~date1FirstDay, '&lt; '~ date1LastDay]}) %}
{% set secondRange = craft.entries({fieldHandle: ['and', '&gt;= '~date2FirstDay, '&lt; '~ date2LastDay]}) %}

{% set entries = firstRange |merge(secondRange) %}

This is the way to do it. Also you should query for the ids, and then merge those, and then query by id.
I hope this will help.