Date Limit on Element Query I have a custom date field - "renewalDate" - which I want to use to limit an entry query. Here is the code:

When I run that it throws this error:

"Calling unknown method: craft\behaviors\ElementQueryBehavior::renewalDate()"

{% set dateStart = now|date('Y-m-d H:i')  %}
{% set dateEnd = date('next month') | date('Y-m-d H:i')  %}

{% set list = craft.users()
.group('members') 
.status(null)
.orderBy('lastName asc')
.renewalDate('and', '&gt;= #{dateStart}', '&lt; #{dateEnd}')

%}


However, this works fine:

{% set list = craft.users()
.group('members') 
.status(null)
.orderBy('lastName asc')
.renewalDate('&gt;= #{dateStart}') 
%}


So, the problem seems to be related to using "and". 

I have done this before using Craft 2, but it is not working with Craft 3. I am missing something here?

Thanks!
Have you tried

.renewalDate('and', "&gt;= #{dateStart}", "&lt; #{dateEnd}")


The difference is the double quotes. I don't think that single quotes support interpolation.

However, I'm not sure in that case why the version without the 'and' works.

OK, have just tried it myself...
I created a section called test and added a single date field called renewalDate and the code below works on a simple listing page.

{% set dateStart = now|date('Y-m-d H:i')  %}
{% set dateEnd = date('next month') | date('Y-m-d H:i')  %}

{% set params = {
  section : 'test',
  orderBy : 'renewalDate asc',
  renewalDate : ['and', "&gt;= #{dateStart}", "&lt; #{dateEnd}"]
} %}

&lt;h1&gt;Entries&lt;/h1&gt;
{% for entry in craft.entries(params).all() %}
    &lt;p&gt;{{ entry.title }}&lt;/p&gt;
{% endfor %}