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

Where in SQL. 1

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi Guys,

I have a Syntax error with the last bit of this code:

CurrentDb.Execute "UPDATE tblstaffCodes SET Discipline = '" & Forms!FormJobDescriptions!FormStaffLookup!Discipline & "' WHERE PayNumber = '" & Forms!FormJobDescriptions!FormStaffLookup!Text1 & "' and WHERE AdditPayNumber = 0"

I tried the ampersand and just "where" but no success :-(

AdditPayNumber is numeric
 
Take out the second "WHERE"...you don't need it. It should be... and AdditPayNumber = 0
 
Thanks rjoubert,

I never thought of that one.

CurrentDb.Execute "UPDATE tblstaffCodes SET Discipline = '" & Forms!FormJobDescriptions!FormStaffLookup!Discipline & "' WHERE PayNumber = '" & Forms!FormJobDescriptions!FormStaffLookup!Text1 & "' and AdditPayNumber =0"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top