I am using Magento 2.2.2
I have created one attribute "Retail Price". Input type for this attribute is "Price". I have added values in some products for this attribute. Now I want to load product collection based on "Retail Price" range. I have tried using the following code:
$collection = $productCollection->addAttributeToSelect('*')
->addAttributeToFilter('status', 1)
->addAttributeToFilter('retail_price' , array('from' => 501, 'to' => 700));
$collection->load();
After using the above code I didn't get any products in the result. So, what can be the issue in the above code?