此代碼在Microsoft Access中不起作用,但可用於Microsoft SQL Server Management Studio。我可以做什麼使這項工作在Access?我一直得到一個爲什麼此SQL代碼在Microsoft Access中不起作用,但在SQL Server Management Studio中起作用?
「查詢表達式CAST(od.UnitPrice * od.Quantity *(1 + od.Discount)中的語法錯誤(缺少運算符)爲小數點(10,2))'Order Total' 。
Select TOP 5
c.CompanyName as 'Company Name',
CAST(od.UnitPrice * od.Quantity * (1 + od.Discount) as decimal(10, 2)) 'Order Total'
From
Customers as c
Join
Orders as o On c.CustomerID = o.CustomerID
Join
OrderDetails as od On o.OrderID = od.OrderID
Where
od.UnitPrice * od.Quantity * (1 + od.Discount) > 5000
AND c.Country IN ('Austria', 'Denmark', 'Germany', 'Ireland', 'Sweden')
Order By
o.OrderDate desc
這是錯誤嗎? – M84
@gurV這是'cast'的錯誤。我不明白爲什麼。 –