Indicia-Team / warehouse

GNU General Public License v3.0
5 stars 3 forks source link

SQL error when trying to filter Occurrences list by date #328

Open Gary-van-Breda opened 5 years ago

Gary-van-Breda commented 5 years ago

http://warehouse1.indicia.org.uk/index.php/occurrence

The data did not load successfully. The reason given was: There was an SQL error: ERROR: operator does not exist: date ~~* unknown LINE 3: WHERE "date_start" ILIKE '%2019%' ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts. - SELECT "gv_occurrences"."id", "gv_occurrences"."website", "gv_occurrences"."survey", "gv_occurrences"."sample_id", "gv_occurrences"."taxon", "gv_occurrences"."date_start", "gv_occurrences"."date_end", "gv_occurrences"."date_type", "gv_occurrences"."entered_sref", "gv_occurrences"."entered_sref_system", "gv_occurrences"."location_name", "gv_occurrences"."name", "gv_occurrences"."deleted", "gv_occurrences"."website_id" FROM gv_occurrences WHERE "date_start" ILIKE '%2019%' LIMIT 21 OFFSET 0

johnvanbreda commented 5 years ago

Date filtering is broken on the warehouse occurrences list as it is treating the date as a simple string. I'd advocate for switching the occurrences list view for a proper Explore style grid with filter builder, but not sure where that lies in priorities.