0

Is possible to cast DateTimeOffset to a long (the date in milliseconds)

ex:

url/Fiels?$filter=cast(Birthdate,'Edm.Decimal') gt 0

This would return me all the fields that have the birthdate after 1 january 1970...

But I get

   {
  "error":{
    "code":"","message":"The query specified in the URI is not valid. The binary operator GreaterThan is not defined for the types 'System.Object' and 'System.Nullable`1[System.Decimal]'."
  }
}
Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94

1 Answers1

1

Please check the spec, only numeric primitive types are supported to cast to another primitive type. So the convention you want is not support directly, but you can write your custom unbound function to archive it.

Karata
  • 1,079
  • 8
  • 16