Database Anniversary Dates: Difference between revisions
Ttenbergen (talk | contribs) |
Ttenbergen (talk | contribs) |
||
| Line 2: | Line 2: | ||
<!-- this will self-update the age BUT NOT THE UNITS as they are added and removed --> | <!-- this will self-update the age BUT NOT THE UNITS as they are added and removed --> | ||
== | == Current == | ||
{{#cargo_query: | |||
tables=CollectionLocation | |||
|fields=_pageName=unit, | |||
StartDate=start, | |||
DATEDIFF(COALESCE(EndDate, CURRENT_DATE()),StartDate)=days, | |||
CONCAT("{{age{{!}}EndDate=",COALESCE(EndDate, CURRENT_DATE()),"{{!}}StartDate=",StartDate,"}}")=years | |||
|where=EndDate IS NULL | |||
|order by=unit | |||
|limit=100 | |||
|default=no results were found | |||
}} | |||
== Old == | |||
{{#cargo_query: | {{#cargo_query: | ||
tables=CollectionLocation | tables=CollectionLocation | ||
| Line 10: | Line 23: | ||
DATEDIFF(COALESCE(EndDate, CURRENT_DATE()),StartDate)=days, | DATEDIFF(COALESCE(EndDate, CURRENT_DATE()),StartDate)=days, | ||
CONCAT("{{age{{!}}EndDate=",COALESCE(EndDate, CURRENT_DATE()),"{{!}}StartDate=",StartDate,"}}")=years | CONCAT("{{age{{!}}EndDate=",COALESCE(EndDate, CURRENT_DATE()),"{{!}}StartDate=",StartDate,"}}")=years | ||
|where=EndDate IS NOT NULL | |||
|order by=unit | |order by=unit | ||
|limit=100 | |limit=100 | ||
|default=no results were found | |default=no results were found | ||
}} | }} | ||
* {{Location Age | Location =GRA EMIP }} | * {{Location Age | Location =GRA EMIP }} | ||