<div dir="ltr"><div><div><div><div><div>Hi Phil,<br><br></div>For manipulating dates throught SQL you should use ISO format ("YYYY-MM-DD").<br><br></div>Then, you can use a virtual layer with :<br><br></div>SELECT stationid, MAX(obs_date) FROM your_layer GROUP BY stationid<br><br></div>Cheers,<br><br></div>Pierma<br><div class="gmail_extra"><br><div class="gmail_quote">2016-03-30 13:09 GMT+11:00 Phil (The Geek) Wyatt <span dir="ltr"><<a href="mailto:phil@wyatt-family.com" target="_blank">phil@wyatt-family.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-AU"><div><p class="MsoNormal">I must be thick, but I can't get my head around this in QGIS<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Data<u></u><u></u></p><table style="width:104.0pt;border-collapse:collapse" width="139" border="0" cellpadding="0" cellspacing="0"><tbody><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">stationid_<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal"><span style="color:black">obs_date<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BK21<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">28/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BK21<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">29/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BK21<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">30/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BL22<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">28/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BL22<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">29/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BL22<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">30/03/2016<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="64"><p class="MsoNormal"><span style="color:black">BL22<u></u><u></u></span></p></td><td style="width:56.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt" nowrap valign="bottom" width="75"><p class="MsoNormal" style="text-align:right" align="right"><span style="color:black">31/03/2016<u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">How do I select the Maximum date for each station ID?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The data will be coming from a GEOJSON feed but I can also pull it as a shape file if needs be<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Cheers - Phil<u></u><u></u></span></p></div></div><br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Pierre-Marie Le Dantec<br><br>73.64.34<br></div></div></div>
</div></div>