[SOLVED] [MYSQL] STR_TO_DATE return null value
Hi all,
I need to select from my database only the yesterday value. The problem is that the value data is set to VARCHAR so I've used STR_TO_DATE to convert it:
but this string return null value instead of yesterday values ;(
any help will be appreciated
Hi all,
I need to select from my database only the yesterday value. The problem is that the value data is set to VARCHAR so I've used STR_TO_DATE to convert it:
Code:
SELECT data_string_field FROM table
WHERE STR_TO_DATE(data_string_field, "%m/%d/%Y") = DATE_ADD( CURDATE(), INTERVAL -1 DAY );
but this string return null value instead of yesterday values ;(
any help will be appreciated
Last edited:






