NFL Query

50 views
Skip to first unread message

Tim Ross

unread,
Sep 3, 2024, 11:02:32 AM9/3/24
to SDQL API
I'm trying to get the last five games of a team vs their current opponent:

 date,team,site,runs,total,o:team,o:line,o:runs,line@team='{team}' and o:team='{opponent}' and date<{today_date} and n5:date>={today_date}

This isn't exactly returning what I want, any tips on how to better achieve this?

I know we want api questions mostly on here, but I asked on twitter and haven't heard anything back. 

Joe Meyer

unread,
Sep 3, 2024, 1:40:54 PM9/3/24
to sdq...@googlegroups.com
Tim,

The basic form for this type of query is:

date,team,site,runs,total,o:team,o:line,o:runs,line@team='Cubs' and o:team='Reds' and date<today and N5:date>today

Note the use of 'N' for next matchup rather than 'n' for next game.

That works except when the team does not have at least 5 remaining matchups.

To cover all cases, use the SDQL:
date,team,site,runs,total,o:team,o:line,o:runs,line@team='Cubs' and o:team='Reds' and date<today and (_tNNNNN is None or N5:date>today)

best regards,

Joe Meyer


--

---
You received this message because you are subscribed to the Google Groups "SDQL API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sdqlapi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sdqlapi/e696f764-f624-4e5b-8355-60103a22ec7cn%40googlegroups.com.

Tim Ross

unread,
Sep 3, 2024, 2:18:06 PM9/3/24
to SDQL API
Thank you! 
Reply all
Reply to author
Forward
0 new messages