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 Check...

Status
Not open for further replies.

SnayJ

Programmer
Feb 27, 2008
65
US

Please check my syntax?

Code:
UPDATE STATUStbl SET FOLLOWUPDATE = #6/9/2015#, STATUSHISTORY = 'Will be at the dock on Monday
FOLLOW-UP DATE CHANGED TO 6/9/2015' WHERE STATUSID = 1

Table: STATUStbl
Field: FOLLOWUPDATE; date
STATUSHISTORY; text (memo)
STATUSID; Autonumber (primary key)

Right now I'm getting Run-time error '3129': Invalid SQL Statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

 
What is in the query before "UPDATE"?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I would try:
SQL:
UPDATE STATUStbl SET FOLLOWUPDATE = [b][COLOR=#CC0000][highlight #FCE94F]'[/highlight][/color][/b]6/9/2015[b][COLOR=#CC0000][highlight #FCE94F]'[/highlight][/color][/b], STATUSHISTORY = 'Will be at the dock on Monday
FOLLOW-UP DATE CHANGED TO 6/9/2015' WHERE STATUSID = 1

Duane
Hook'D on Access
MS Access MVP
 
Nevermind...

I figured it out. Problem wasn't in the syntax of the SQL but in the docmd.runsql.

I put docmd.runsql "SQLNAME"
and it should have been docmd.runsql(SQLNAME)

Sorry, it's been a while.
 
Wow, Maouji. You've been on tek-tips since 2008, and this is your first post. Um, Welcome? [wink]

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top