locked
How does OData filter query compare to two strings? RRS feed

Answers

  • Hi,

    The OData protocol itself doesn't mandate a specific implementation of "less than or equal", other than it has to be consistent throughout the service.  However, I think you'll find that in most systems, the string "Browsers" is considered greater than the string "B", which is why your two queries return different results (i.e., when the Name of an entity is "Browsers", "$filter=Name le 'B'" is not true for that entity).

    In C# for example, string.Compare("Browsers", "B", StringComparision.Ordinal) will return a value greater than zero, indicating that "Browsers" > "B".

    • Marked as answer by byHesed Wednesday, March 27, 2013 5:10 PM
    Thursday, March 21, 2013 6:03 PM