Hi Mark,

yes it should work, you can get a list accessiond by year with:

SELECT to_char(date_trunc('year', t1.ts), 'YYYY') AS year, count(*) FROM 
(SELECT to_timestamp(text_value, 'YYYY-MM-DD') AS ts FROM metadatavalue 
WHERE metadata_field_id = (SELECT metadata_field_id FROM 
metadatafieldregistry WHERE metadata_schema_id = 1 AND element = 'date' 
  AND qualifier = 'accessioned')) t1 GROUP BY date_trunc('year', t1.ts) 
order by year;

Hope this helps

Claudia



Am 30.01.2015 um 17:07 schrieb Mark H. Wood:
> I wanted to double-check: given DSpace 4.0 with PostgreSQL, should
> this not give me the number of Items submitted in the year 2014?
>
>    SELECT COUNT(*) FROM metadatavalue
>     WHERE metadata_field_id =
>      (SELECT metadata_field_id FROM metadatafieldregistry
>       WHERE metadata_schema_id = 1
>       AND element = 'date'
>       AND qualifier = 'accessioned')
>     AND to_date(text_value,'YYYY-MM-DD') >= '2014-01-01'
>     AND to_date(text_value,'YYYY-MM-DD') < '2015-01-01';
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
>
>
>
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette: 
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>

-- 
Claudia Juergen
Eldorado

Technische Universität Dortmund
Universitätsbibliothek
Vogelpothsweg 76
44227 Dortmund

Tel.: +49 231-755 40 43
Fax: +49 231-755 40 32
[email protected]
www.ub.tu-dortmund.de


Wichtiger Hinweis: Die Information in dieser E-Mail ist vertraulich. Sie 
ist ausschließlich für den Adressaten bestimmt. Sollten Sie nicht der 
für diese E-Mail bestimmte Adressat sein, unterrichten Sie bitte den 
Absender und vernichten Sie diese Mail. Vielen Dank.
Unbeschadet der Korrespondenz per E-Mail sind unsere Erklärungen 
ausschließlich final rechtsverbindlich, wenn sie in herkömmlicher 
Schriftform (mit eigenhändiger Unterschrift) oder durch Übermittlung 
eines solchen Schriftstücks per Telefax erfolgen.

Important note: The information included in this e-mail is confidential. 
It is solely intended for the recipient. If you are not the intended 
recipient of this e-mail please contact the sender and delete this 
message. Thank you.
Without prejudice of e-mail correspondence our statements are only 
legally binding when they are made in the conventional written form 
(with personal signature) or when such documents are sent by fax.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to