I have two sets of code (below) that fetches items from a container that match conditions specified in "where" statement. One with the sql query works as expected