Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Statement to update the date

I have a string 1993-08-02 00:00:00.0 and I would like to update the date field in a Access Table

This is what I have but it is not working.

UPDATE [Table] SET `Birthdate` = '1993-08-02 00:00:00.0' WHERE `ID` = 000
like image 559
twodayslate Avatar asked Aug 16 '26 20:08

twodayslate


1 Answers

Dates are not strings, but either of the following will result in a date:

DATE [Table] SET `Birthdate` = CDate('1993-08-02 00:00:00.0') WHERE `ID` = 000

(see the documentation for CDate)

DATE [Table] SET `Birthdate` = #08/02/1993# WHERE `ID` = 000
like image 105
Dolph Avatar answered Aug 18 '26 10:08

Dolph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!