https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37416

--- Comment #4 from David Nind <[email protected]> ---
SQL query to identify dates with 0000-00-00
===========================================

Date fields in the items table: dateaccessioned, replacementpricedate,
datelastborrowed, datelastseen, damaged_on, itemlost_on, withdrawn_on,
deleted_on, onloan

Not sure about: timestamp

Identify any date fields with 000-00-00 values:
-----------------------------------------------

select dateaccessioned, replacementpricedate, datelastborrowed, datelastseen,
damaged_on, itemlost_on, withdrawn_on, deleted_on, onloan 
FROM items
WHERE 
dateaccessioned LIKE '0000-00-00%' OR 
replacementpricedate LIKE '0000-00-00%' OR 
datelastborrowed LIKE '0000-00-00%' OR 
datelastseen LIKE '0000-00-00%' OR 
damaged_on LIKE '0000-00-00%' OR 
itemlost_on LIKE '0000-00-00%' OR 
withdrawn_on LIKE '0000-00-00%' OR 
deleted_on LIKE '0000-00-00%' OR 
onloan LIKE '0000-00-00%'

SQL to fix date issues (example):
---------------------------------

UPDATE items
SET replacementpricedate = null 
WHERE replacementpricedate = '0000-00-00'


Source - Chats: 
- https://chat.koha-community.org/koha-community/pl/wjyuc67s3jgsf88kze8nzgiqne
- https://chat.koha-community.org/koha-community/pl/d3rnttkbz3b1ijcb9s8fgp58xo

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to