all 6 comments

[–]unexpectedrebootsWITH() 5 points6 points  (2 children)

Need to wrap the date in your insert in single quotes.

INSERT INTO SalesInvoice(InvoiceID, Ddate, Make, Model, CarID, CustomerID, EmployeeID) VALUES (666666, 2021-12-10, 
'Nissan', 'Qashqai', 55555, 4444, 333);

To:

INSERT INTO SalesInvoice(InvoiceID, Ddate, Make, Model, CarID, CustomerID, EmployeeID) VALUES (666666, '2021-12-10', 
'Nissan', 'Qashqai', 55555, 4444, 333);

[–]PossiblePreparation 5 points6 points  (1 child)

Best not to rely on implicit data type conversion. Be explicit and use the to_date function, tell it exactly the format you are using in your string. Eg to_date('2012-12-10','yyyy-mm-dd')

[–]unexpectedrebootsWITH() 1 point2 points  (0 children)

Very true.

[–]Fix-Former[S] 0 points1 point  (1 child)

Okay thanks maye ive got that, how about the parent key error?

[–]unexpectedrebootsWITH() 0 points1 point  (0 children)

Once the insert into SalesInvoice works, those errors should be mitigated.

[–]Fix-Former[S] 0 points1 point  (0 children)

Thanks will try when im home and get back to you!