Link to home
Start Free TrialLog in
Avatar of APS NZ
APS NZFlag for New Zealand

asked on

Help with SQL Server query syntax

We are (finally) upgrading from MSAccess to SQL Server 2008 R2.  I am new to SQL Server.  I have the following query

<CFSET WeekDate=MakeODBCDate("12/08/2012")>

<CFQUERY NAME="MyQuery" DATASOURCE="JobOrder#Sfx#">
  UPDATE Applic_Temp_Group.dbo.TempEmployeesFile
  INNER JOIN TsheetsThisWeek ON TempEmployeesFile.UniqueVal =TsheetsThisWeek.UniqueVal
  SET TempEmployeesFile.Wkg ='Yes'
  WHERE TsheetsThisWeek.WEnded=<CFQUERYPARAM Value="#WeekDate#" CFSQLTYPE="CF_SQL_DATE">
</CFQUERY>

It crashes and says "Incorrect syntax near the keyword INNER".  What is the correct syntax I need?
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of APS NZ

ASKER

Thanks lwadwell - it works fine.  I can see I'm going to have lots of queries to recode!