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

syntax error in updaet statement

Status
Not open for further replies.

case81

Programmer
Jan 10, 2002
23
IE
hey all,

sorry to bother yis, i'm getting a syntax error in an update here's the code:

rsteamstoday.open sqlstr,dbcon

While rsTeamsToday.EOF = False
chkdate = rsTeamsToday.Fields("datecreated")
If Day(chkdate) = Day(today) And Month(chkdate) = Month(today) And Year(today) = Year(chkdate) Then
TeamsDayCnt = TeamsDayCnt + 1
tid = rsTeamsToday.Fields("team_id")


***** dbcon1.Execute ("UPDATE teams SET day='yes' WHERE team_id=" & tid) *****

End If
rsTeamsToday.MoveNext

Wend

the dbcon1.execute gives me the error, and when i highlight it, it reads as : (UPDATE teams set day='ye..."UPDATE teams SET day='yes' WHERE team_id=45")


????

any help is very much appreciated,

thanks guys
 
dbcon1.Execute ("UPDATE teams SET day='yes' WHERE team_id=" & tid) *****

Have you tried using the update statement without the () yet? I would suggest trying something like:

strSQL = "UPDATE teams SET day = 'yes' WHERE team_id = " _
& tid & ";"

dbcon1.Execute strSQL

...where strSQL is defined as variable type String

If this doesn't work, please let me know. :)

HTH

Greg Tammi, ATS Alarm Supervisor
E-mail: gtammi@atsbell.com
 
hey thanks,
nah it was a really stupid thing, day is a reserved word, thanks for replying though :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top