locked
Problem with gteq and lteq arithmatic operators RRS feed

  • Question

  •  

    Hi

     

    I am trying to returns products whose stocks is between 10 and 15. The following URI fails  <http://localhost:2074/Northwind.svc/Products?$filter=UnitsInStock gteq 10 and UnitsInStock lteq 15> with error message

     

    Expression of type 'Boolean' expected at position 0.
       at Microsoft.Data.Web.RequestQueryParser.ExpressionParser.Parse(Type resultType)
       at Microsoft.Data.Web.RequestQueryParser.ParseLambda(IWebDataService service, Type typeForIt, Type resultType, String expression)
       at Microsoft.Data.Web.RequestQueryParser.Where(IWebDataService service, IQueryable source, String predicate)
       at Microsoft.Data.Web.RequestQueryProcessor.ProcessFilter()
       at Microsoft.Data.Web.RequestQueryProcessor.ProcessQuery()
       at Microsoft.Data.Web.RequestQueryProcessor.ProcessQuery(IWebDataService service, RequestDescription description)
       at Microsoft.Data.Web.RequestUriProcessor.ProcessRequestUri(String requestUri, IWebDataService service)
       at Microsoft.Data.Web.WebDataService`1.ProcessIncomingRequest()
    
    The following URI without eq works without any problem.
    http://localhost:2074/Northwind.svc/Products?$filter=UnitsInStock gt 10 and UnitsInStock lt 15
    Balaji
     
     
    Monday, August 4, 2008 10:55 AM

Answers

  • Try ge and le instead of gteq and lteq.

     

     

    Monday, August 4, 2008 4:53 PM
    Moderator

All replies