Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

How do I change an autonumber field into a regular number field in a make-table query?

Hello,  I am running a simple make-table query.  I have two tables, tbl_Contacts and tbl_Categories, each of which has an auto number field.  In tbl_Categories, the auto number field is IdCategory.  As shown in the SQL below, I am trying to make a table, "temp" that includes all records from tbl_Contacts in addition to IdCategory from tbl_Categories.  I would like the field IdCategory to be an integer field in my new table but Access tries to bring it in as an auto number.  How can I change IdCategory into an integer in the course of running this query?

SELECT tbl_Contacts.*, tbl_Categories.[IdCategory] AS IdCategory2 INTO temp
FROM tbl_Categories RIGHT JOIN tbl_Contacts ON tbl_Categories.Category = tbl_Contacts.Category;
0
Saleve
Asked:
Saleve
1 Solution
 
PatHartmanCommented:
You may be able to coerce Access into doing it your way by using a function.

Select cLng(YourID) as NewID .....
0
 
Rey Obrero (Capricorn1)Commented:
try this


SELECT tbl_Contacts.*, clng(tbl_Categories.[IdCategory]) AS IdCategory2 INTO temp
FROM tbl_Categories RIGHT JOIN tbl_Contacts ON tbl_Categories.Category = tbl_Contacts.Category;
0
 
SaleveAuthor Commented:
Perfect.  thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now