开发者

Using INSERT INTO and setting one field value - Access VBA

I'm using INSERT INTO to copy rows of data from one table to another:

INSERT INTO tblNewCustomers (CustomerID, [Last Name], [First Name])
SELECT CustomerID, [Last Name], [First Name]
FROM tblOldCustomers

How can I set one of the field values in tblNewCus开发者_Python百科tomers for all of the new records that I am importing in withn this statement e.g

tblNewCustomers.existCustomer = TRUE

Thanks in advance for any help

Noel


INSERT INTO tblNewCustomers (CustomerID, [Last Name], 
    [First Name], [existCustomer])
SELECT CustomerID, [Last Name], [First Name], True 
FROM tblOldCustomers


You can also ignore the field in the SQL sentence and make it have a default in true. BUT I think Smandoli solution is more accurate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜