This question has been addressed before many times, but the answers are about the wrong format of the date. The format of the date I have used is correct: YYYY-MM-DD according to the manual.
So what could be the possible cause of this error?
I am using MySQL 5.5 if that matters.
EDIT:- The query I am trying to execute:-
insert into table2 (pk_id)
select pk_id from table1
where pk_date in (2014-01-04, 2014-02-05, 2014-03-23, 2014-05-01, 2014-07-28)
order by pk_id asc;
The issue is on the IN condition for dates, date is string and it needs to be quoted with single quote as
where pk_date in ('2014-01-04', '2014-02-05', '2014-03-23', '2014-05-01', '2014-07-28')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With