How to use a between operator in an entity field query?
If you want to include 2 then simply pass 2.

$query-&gt;propertyCondition('nid', array(2));


While using between operator, it includes the range values too. So you can just pass the range values you want to include. Still if you want to exclude these range then add one more condition like :

$query-&gt;propertyCondition('nid', array(1, 3), 'BETWEEN'); // 1, 3 to get the nid 2
$query-&gt;propertyCondition('nid', array(1, 3), 'NOT IN'); // exclude these nids