2

Can somebody please help me figure out what is wrong with this query?

https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed<10

It failed with error code: query.soql.type-mismatch

the "speed" column of the table is declared as text. I am having trouble in converting speed to a real (decimal) number for the comparison. Thanks

Andrew Tang
  • 111
  • 1
  • 5

2 Answers2

1

Try casting the column with ::number, like this:

GET https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed::number > 31.69
chrismetcalf
  • 1,556
  • 1
  • 8
  • 7
0

Put the number in parenthesis, like this:

https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed<"10"

or if you need it url encoded, use this:

https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed%3C%2210%22

Ben Shoval
  • 1,732
  • 1
  • 15
  • 20