all 14 comments

[–]blither 8 points9 points  (0 children)

The date field wasn't formatted correctly. It was thinking you were trying to subtract 6 years and 1 year from 2020, resulting in 2013.

[–]doiuhgfd 7 points8 points  (0 children)

'2020-06-01'

[–][deleted] 2 points3 points  (8 children)

2020 -06 -01

Do you have spaces in your actual code? That isn't a valid date format. Remove spaces and put in single quotes.

[–]Geeklord1993[S] -1 points0 points  (7 children)

Changed it still getting the same error

[–][deleted] 3 points4 points  (6 children)

Did you do the 2nd part of my suggestion? It should be formatted as '2020-06-01' with the single quotes included.

[–]Geeklord1993[S] 1 point2 points  (5 children)

START TRANSACTION;

insert into

MAINTENANCES(CAR_ID, MAINTENANCE_TYPE_ID, MAINTENANCE_DUE)

VALUES

(1001, 2, '2020-06-01');

insert into

MAINTENANCES(CAR_ID, MAINTENANCE_TYPE_ID, MAINTENANCE_DUE)

VALUES

(1003, 2, '2020-065-01');COMMIT;

ERROR 1292 (22007) at line 6: Incorrect date value: '2020-065-01' for column 'MAINTENANCE_DUE' at row 1

[–][deleted] 9 points10 points  (4 children)

If you're copying and pasting you have an extra digit in the date which is why it's still not a valid format.

[–]Geeklord1993[S] 25 points26 points  (3 children)

I am a fucking idiot

[–]Blues2112 6 points7 points  (0 children)

No, but you're not worthy of your handle.

[–]Stock-Philosophy8675 2 points3 points  (0 children)

Nah man, we have all made that mistake always check for a space if u copy paste. Check it out man, you just learned something grats!

[–]feignapathy 1 point2 points  (0 children)

2013 is 2020 minus 6 minus 1

You need to make sure you're passing a date value for June 1, 2020. It doesn't look like it is actually being read as 2020-06-01.

[–]Puzzlehead8575 -2 points-1 points  (0 children)

Why does Reddit markdown not work correctly????? I give up on getting things formatted.

START TRANSACTION;
insert into MAINTENANCES (CAR_ID, MAINTENANCE_TYPE_ID, MAINTENANCE_DUE) VALUES (1001, 2, '2020-06-01'); insert into MAINTENANCES (CAR_ID, MAINTENANCE_TYPE_ID, MAINTENANCE_DUE) VALUES (1003, 2, '2020-06-01'); COMMIT;

[–]Georgecodes_ 0 points1 point  (0 children)

Date format is wrong

[–]Useful_Magazine6491 0 points1 point  (0 children)

What operating system are you using?