Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql syntax error

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I get sql syntax error when I enter the code below, what is wrong with it?


Code:
INSERT INTO tblLogInOut  Date, LogIn,LogOut,Site,Activity) values (#6/18/2006#,"02:00 AM","11:30 AM","Safe Harbor","Holiday")
[code]

Newbie in search of knowledge
 
vttech,
Punctuation? [red](in bold)[/red]
Code:
INSERT INTO [b][red]([/red][/b]tblLogInOut[b][red],[/red][/b] Date, LogIn, LogOut, Site,Activity) values (#6/18/2006#,"02:00 AM","11:30 AM","Safe Harbor","Holiday")[b][red];[/red][/b]

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
As you asked in the Access VBA forum:
Dim strSQL As String
strSQL = "INSERT INTO tblLogInOut ([Date],LogIn,LogOut,Site,Activity)" _
& " VALUES (#2006-18-06#,'02:00 AM','11:30 AM','Safe Harbor','Holiday')"
CurrentDb.Execute strSQL

BTW, are LogIn and LogOut really text ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top