thanks!<br><br>On Sunday, May 22, 2016, Donald Stufft <<a href="mailto:donald@stufft.io">donald@stufft.io</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On May 22, 2016, at 3:39 AM, Wes Turner <<a href="javascript:_e(%7B%7D,'cvml','wes.turner@gmail.com');" target="_blank">wes.turner@gmail.com</a>> wrote:</div><br><div>- to query, say, a month's worth of data, what would need to be done?<div>- "sharded by day" ... UTC?<br><br></div></div></blockquote><br></div><div><br></div><div>You use a TABLE_DATE_RANGE() function, like this:</div><div><br></div><div><br></div><div> TABLE_DATE_RANGE([the-psf:pypi.downloads], TIMESTAMP("20160114"), TIMESTAMP("20160214”))</div><div><br></div><div>Or, if you wanted to get fancier you could do something like this for the “last 30 days”:</div><div><br></div><div> TABLE_DATE_RANGE([the-psf:pypi.downloads], DATE_ADD(CURRENT_TIMESTAMP(), -1, "month"), CURRENT_TIMESTAMP())</div><div><br></div><div><br></div><div>You can see examples of it in use at <a href="https://gist.github.com/alex/4f100a9592b05e9b4d63" target="_blank">https://gist.github.com/alex/4f100a9592b05e9b4d63</a> or see the query docs at <a href="https://cloud.google.com/bigquery/query-reference" target="_blank">https://cloud.google.com/bigquery/query-reference</a>.</div><br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br>—<br>Donald Stufft<br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br></div><br>
</div>
<br></div></blockquote>