Page 1 of 1

How to update all the records in a table with SQL?

Posted: Tue Jul 30, 2024 9:28 am
by gvc

What event do I use to update all the records in a table with this SQL? What is the correct syntax?

UPDATE ListDecades SET Finish = CASE WHEN YEAR(CURDATE()) - DecadeInteger < 0 THEN 0 ELSE YEAR(CURDATE()) - DecadeInteger END, Start = CASE WHEN YEAR(CURDATE()) - DecadeInteger - 10 < 0 THEN 0 ELSE YEAR(CURDATE()) - DecadeInteger - 10 END


Re: update sql

Posted: Tue Jul 30, 2024 9:34 am
by mobhar

You may use ExecuteStatement global function to execute your SQL Update above. If you want to update after editing an existing record, then you may put that code in Row_Updated server event.


Re: How to update all the records in a table with SQL?

Posted: Tue Jul 30, 2024 8:37 pm
by gvc

Perfect! Thank you!

Gary