Hi

The following should work (on Postgres):

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 = 12) t1 GROUP BY date_trunc('year', t1.ts);

George

On 12/10/10 16:47, Admire wrote:

Hi All,

Hope I find you well. I am interested in establishing the number of items deposited each year in our IR. Is there anyone out there who had done that and can provide me with the SQL statement to do that.

Regards,

Admire


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2&  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb


_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to