我尝试使用SELECT ... INTO语句创建表。该表已创建并正确填充,但我想更改其中两列的数据类型。
SELECT DISTINCTROW
AR_Server_Pre.OrderID,
AR_Server_Pre.LineTotal,
AR_Server_Pre.[Total payments],
AR_Server_Pre.ShipDate,
(AR_Server_Pre.LineTotal-nz(AR_Server_Pre.[Total Payments])) AS AmountDue
INTO AR_Final
FROM AR_Server_Pre
WHERE
((([AR_Server_Pre].[LineTotal]-nz([AR_Server_Pre].[Total Payments]))>0.5)
AND
((AR_Server_Pre.ShipDate)<Date()));
我想将列类型的货币分配给LineTotal和AmountDue。 AR_Server_Pre是一个选择查询,因此在该表中更改它的简单解决方案无法正常工作。
答案 0 :(得分:2)
您可以将指定字段包装在CCur()
函数中以强制它们为Currency
,例如,
SELECT DISTINCTROW
AR_Server_Pre.OrderID,
CCur(AR_Server_Pre.LineTotal) AS LineTotal,
...