when I try to insert my date values in all my other tables it works fine, except of one. Whatever format I try I always get the error, that the inserted value couldn't be converted from an input char to the expected date format.
That's how I insert my values
-- ServiceTicket
INSERT INTO ServiceTicket
VALUES ('90000', '01-5-2019', '50000', '10000', '70000', 200.00, 100.00, 5.00, 350.00) --Error converting into DATE type
And this is the table structure:
CREATE TABLE dbo.ServiceTicket (
ticketIssueNo INT NOT NULL IDENTITY(1,1) PRIMARY KEY, --Identity autoincrements
serviceDate DATE NOT NULL,
vehicleId CHAR(8) NOT NULL,
customerId CHAR(8) NOT NULL,
inspectionId CHAR(8) NOT NULL,
serviceCost DECIMAL(10,4) NOT NULL CHECK(serviceCost BETWEEN 0.0 AND 99999.0) DEFAULT 0.0,
inspectionCost DECIMAL(10,4) NOT NULL CHECK(inspectionCost BETWEEN 0.0 AND 99999.0) DEFAULT 0.0,
repairCost DECIMAL(2,2) NOT NULL CHECK(repairCost BETWEEN 0.0 AND 99999.0) DEFAULT 0.0,
GST DECIMAL(10,4) NOT NULL DEFAULT 0.0,
amountDue DECIMAL(10,4) NOT NULL CHECK(amountDue BETWEEN 0.0 AND 99999.0) DEFAULT 0.0,
FOREIGN KEY(vehicleId) REFERENCES Vehicle(vehicleId)
ON UPDATE NO ACTION,
FOREIGN KEY(inspectionId) REFERENCES VehicleInspection(inspectionId)
ON UPDATE NO ACTION,
FOREIGN KEY(customerId) REFERENCES Customer(customerId)
ON UPDATE NO ACTION
)
GO
I might overlook something.