Ajay
Ajay

Reputation: 31

how to cast Edm.Guid to Edm.String in odata

how to cast guid into string in odata, i have tried the $filter=(startswith(cast(CustomerID, 'Edm.String'),'1')) but it throws exception Unknown function 'cast'.

Upvotes: 1

Views: 4745

Answers (1)

TomDoesCode
TomDoesCode

Reputation: 3681

To perform a cast, the type shouldn't be in quotes. So it should be:

$filter=startswith(cast(CustomerID, Edm.String),'1')

(I also removed the extra brackets)

Upvotes: 2

Related Questions