Deleting a date from a record
Posted: Thu Jun 04, 2020 10:55 pm
How can you delete a date (and leave it blank) for a record?
If you try to do this on a mariadb field with type DATE you will get an error:
This appears to be a correct error. The SQL:
Is not valid. If the date is set to nothing the SQL should be like:
Is there a way to get nuBuilder to create the correct SQL? Maybe a custom code PHP Before Save that can re-write the SQL statement?
Thanks!
If you try to do this on a mariadb field with type DATE you will get an error:
Code: Select all
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '' for column...
Code: Select all
UPDATE individuals SET `death_date` = '' WHERE `ID` = '3be018e16a985';
Code: Select all
UPDATE individuals SET `death_date` = NULL WHERE `ID` = '3be018e16a985';
Thanks!