I have the following Update query.
UPDATE ELYOSERVICES.dbo.CAREUSAGE a LEFT JOIN VBTGLOBALDATA.dbo.COMPANYCARS b
SET VEHMAKE = MAKE,
VEHMODEL = MODEL,
CONVERT(Char,b.DATESOLD,103)AS LEASEND,
(CASE WHEN b.FUELCARDNUMBER IS NULL THEN 'N' ESLE 'Y')AS FUELCARD,
ON a.REGISTRATION = b.REGISTRATIONNUMBER
WHERE a.CURRENTCAR ='T' AND [DESCRIPTION] NOT LIKE 'Returned*'
When I try to run it I get the error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'a'.
Can you help please?
UPDATE ELYOSERVICES.dbo.CAREUSAGE a LEFT JOIN VBTGLOBALDATA.dbo.COMPANYCARS b
SET VEHMAKE = MAKE,
VEHMODEL = MODEL,
CONVERT(Char,b.DATESOLD,103)AS LEASEND,
(CASE WHEN b.FUELCARDNUMBER IS NULL THEN 'N' ESLE 'Y')AS FUELCARD,
ON a.REGISTRATION = b.REGISTRATIONNUMBER
WHERE a.CURRENTCAR ='T' AND [DESCRIPTION] NOT LIKE 'Returned*'
When I try to run it I get the error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'a'.
Can you help please?