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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error with sql INSERT 2

Status
Not open for further replies.

iisman

Technical User
Mar 6, 2005
85
CA
When using:

Code:
								sql_insert = "insert into fullsizep (toperson, sendto, filename) values ('" & _
								toperson & "', '" & sendto & "', '" & filename & "')"

I submit the info to the DB.

I have added a field called timestamp to the DB and try to use:

Code:
								sql_insert = "insert into fullsizep (toperson, sendto, filename, timeStamp) values ('" & _
								toperson & "', '" & sendto & "', '" & filename & "', 'date() + time()')"

With this , i get teh "syntax error"

Any suggestions? I can not seem to remedy this.
 
If it is Access, you could set the default value property of the field to =Now(), else, I think it should work in this query using:

[tt]...toperson & "', '" & sendto & "', '" & filename & "', now())"[/tt]

Roy-Vidar
 
Thanks for the response.

Unfortunately that did not solve it.

getting error

Syntax error in INSERT INTO statement.

I have verified that the field names match. not sure what else to check.
 
Try to replace this:
...toperson & "', '" & sendto & "', '" & filename & "', now())"
by this:
...toperson & "', '" & sendto & "', '" & filename & "', " & now() & ")"

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

Part and Inventory Search

Sponsor

Back
Top