Insert statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I haven't quite caught on to getting this right. Thanks in advance for
helping my syntax. Something's wrong with the quote marks:

strInsert = "INSERT SentinelNodeSt(AppointmentID, EmpCreated,
EmpUpdated)" & _
" VALUES(" & mlngAppointmentID & ", ' " & fstrGetUserName & " ', ' " &
fstrGetUserName " ')"

TIA
 
It looks like you're missing an ampersand near the end:
fstrGetUserName & " ')"
^
 
You are missing the key word 'INTO', and unless you want to put spaces into
the data you need to remove them from inside your single quotes:

strInsert = "INSERT INTO SentinelNodeSt(AppointmentID, EmpCreated,
EmpUpdated)" & _
" VALUES(" & mlngAppointmentID & ", '" & fstrGetUserName & "', '" &
fstrGetUserName "')"

HTH
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top