Page 1 of 1

Can't update timestamp!

Posted: Wed Aug 04, 2004 10:14 am
by Benjamin
Why the *&%$ won't this query work?

Code: Select all

update customers set contract_start='20040805101215' where customer_id='50'
The query doesn't fail because there are other fields in it that DO get updated, but the timestamp continues to be all 0's

Posted: Wed Aug 04, 2004 10:29 am
by hawleyjr
modify the field to be a datetime field.

Posted: Wed Aug 04, 2004 10:33 am
by JAM
Or perhaps:

Code: Select all

update customers set contract_start=unix_timestamp('20040805101215') where customer_id='50'

Posted: Wed Aug 04, 2004 5:23 pm
by Benjamin
What is wrong with the original query?

Posted: Wed Aug 04, 2004 6:47 pm
by LiquidPro
It might be nothing with the query, it might be your data type in your SQL table. If you don't have it as a datetime field or if it isn't a int/char of 14 in length... you'll have problems.