<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 22, 2016, at 3:39 AM, Wes Turner <<a href="mailto:wes.turner@gmail.com" class="">wes.turner@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">- to query, say, a month's worth of data, what would need to be done?<div class="">- "sharded by day" ... UTC?<br class=""><br class=""></div></div></blockquote><br class=""></div><div><br class=""></div><div>You use a TABLE_DATE_RANGE() function, like this:</div><div><br class=""></div><div><br class=""></div><div>    TABLE_DATE_RANGE([the-psf:pypi.downloads], TIMESTAMP("20160114"), TIMESTAMP("20160214”))</div><div><br class=""></div><div>Or, if you wanted to get fancier you could do something like this for the “last 30 days”:</div><div><br class=""></div><div>    TABLE_DATE_RANGE([the-psf:pypi.downloads], DATE_ADD(CURRENT_TIMESTAMP(), -1, "month"), CURRENT_TIMESTAMP())</div><div><br class=""></div><div><br class=""></div><div>You can see examples of it in use at <a href="https://gist.github.com/alex/4f100a9592b05e9b4d63" class="">https://gist.github.com/alex/4f100a9592b05e9b4d63</a> or see the query docs at <a href="https://cloud.google.com/bigquery/query-reference" class="">https://cloud.google.com/bigquery/query-reference</a>.</div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">—<br class="">Donald Stufft<br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>