0

I am new to SODA API and attempting to query a SODA API endpoint. I am trying to return the last 4 weeks of records, calculated from today's date, against a "created_date" field. The data has "created_date" date field, I would like to "return all records where created_date is 4 weeks or less from today's date. Said differently, give me records where created_date is between today and (today - 4 weeks).

I cannot work with hardcoded dates like SODA API examples provide, and have been unable to discern the correct method for querying against "date" to return the last four weeks. e.g. of the logic i would like to run: https://data.cityofchicago.org/resource/6zsd-86xi.json?$where= created_date between date and date - 4 weeks

Any guidance is appreciated - this post Using Socrata SODA API to query most recent rows by datetime although related, is an older post and does not satisfy the requirements for querying that I am seeking.

RyNo's
  • 21
  • 3

1 Answers1

0

If you have not already done so, you may want to ask this question at https://support.socrata.com/hc/en-us but I am not sure it is possible.

By the way, just to make sure you caught this nuance, that dataset (Chicago Crimes) has a seven-day lag so even if you did get this to work you would actually get three weeks of data, not four.

Jon
  • 46
  • 3
  • Thank you Jon, the actual dataset I'm looking to query is updated daily, not the crimes dataset. I may try posting the question at the link you specified, thanks for suggesting. – RyNo's Feb 29 '20 at 01:07