1

I have a table with two fields, IDCopy and ID. I want to copy the value of ID into IDCopy because ID is a number field and I need a second copy of this field as a text field.

I am used to doing things like this on sql server

UPDATE table SET table.IDCopy= table.ID;

But when I try to run that query in access it asks me for the parameter value of ID. What is the syntax for setting one column in a table to another column in Access?

4

1 回答 1

3

您可以使用CStr()ID数字转换为文本。当IDCopy是文本并且ID是数字时,这应该有效。

UPDATE [table] SET IDCopy = CStr(ID);

我将表名括起来,因为table它是保留字。

如果 Access 仍然认为ID是此查询的参数,[table]则不包含名为ID.

于 2013-09-13T14:36:13.853 回答