Hi Evelio,

On 15/09/11 01:23, Evelio Martínez wrote:
> When we invoke the following scripts
> 
> [bin]# ./stat-initial 
> [bin]# ./stat-monthly 
> 
> We have the same result
> 
> Exception in thread "main" org.postgresql.util.PSQLException: ERROR:
> invalid input syntax for type timestamp: "2007" 

This is caused by an item for which date.accessioned is just "2007".

You should be able to get the item id with something like the following
query (just a slight modification of the one you posted):

SELECT item_id FROM item WHERE in_archive = true AND withdrawn = false
AND item_id IN (SELECT item_id FROM metadatavalue WHERE text_value =
"2007" AND metadata_field_id = (SELECT metadata_field_id FROM
metadatafieldregistry WHERE element = 'date' AND qualifier =
'accessioned'));

DSpace expects the value of this field to be in the same format you got
in your query for last_modified (eg 2008-12-15 09:08:10.66+01).

Once you have fixed the date.accessioned value for this item, your
statistics script should go through fine.

cheers,
Andrea

-- 
Andrea Schweer
IRR Technical Specialist, ITS Information Systems
The University of Waikato, Hamilton, New Zealand

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to