modification to return matching fields when min/max used (must come after min/max in select)