Time processing in sql statement

When we use SQL statements to process database data, we will inevitably encounter insert or update a piece of data. A certain field in the data is in the time format. Then how do we set the parameter format in the SQL statement to the time format, here is a record.

UPDATE t_bill_contract_bill SET property_fee = 480.0, rent_fee =6480.0,amount=6960.0,
start_date=CAST('2019-06-14' AS datetime),end_date=CAST('2019-12-13' AS datetime),update_date=CAST('2020-07-14' AS datetime) 
WHERE contract_id =144 AND `index`=2;

As above, the type of fields such as start_date in the database is date, so we must use this method to process the prepared data into this appropriate form during operation.

Guess you like

Origin blog.csdn.net/weixin_42575020/article/details/107351956