Question:
Syntax error in INSERT INTO statement in MS access?
sweet
2012-08-26 20:50:03 UTC
My professor asked me to insert the following record on tbl Patients using SQL statement... I followed the syntax in http://www.w3schools.com/sql/sql_insert.asp but it always says Syntax error in INSERT INTO statement in MS access when I run it ... I create tbl Admissions,tblDiagnostics and tblPatient ... now since she told me to insert a record in Patients table I do these step "I go to query design i chose tbl Patients and then right click and I chose SQL view and then I typed this in ....
INSERT INTO Hospital Record (PatNo,fName,lName,BirthDate,Address,City,State,Zip)
VALUES (15,'Juan','Dela Cruz','5/6/1998','San Jose','TN',92812);

*please help me find my error :(
Four answers:
Serge M
2012-08-26 21:10:58 UTC
Try this

INSERT INTO tblPatient(PatNo,fName,lName,BirthDate,Address,Cit…

VALUES (15,'Juan','Dela Cruz','5/6/1998','San Jose','TN',92812);
TheMadProfessor
2012-08-27 06:52:14 UTC
Assuming BirthDate is defined as a DATE type, your date value needs to be compatible. IIRC, in Access this would be by enclosing the string in hashtags like this: '#5/6/1998#'
Mohammed Ansari
2012-08-26 22:23:08 UTC
To Solve this kind of Problem you should provide the whole structure of the Table and Error can also come because you may have a column with datatype as int and you are going to insert character or something similar to this...
chottu
2017-02-20 23:40:11 UTC
Ms Access Insert Into Statement


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...