Results 1 to 5 of 5
  1. #1
    jmracura is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Location
    California
    Posts
    3

    Question Make Table Query - Need to Convert Data Type from Text to Number

    Hi Everyone,

    I have table A with a column called ref_id which is a text field. I want to link this to table B that has something called a dep_id that is a number field. I am using a make table query to query Table A and make a temp table where ref_id will be a number.
    I have tried using the Val ([ref_id]) expression in the "update to" row. The query runs, but the data type still shows as "text". Does anyone know what I may be doing wrong? Been struggling with this for about a week now.



    Juan

    Click image for larger version. 

Name:	10-1-2014 2-11-57 PM.jpg 
Views:	12 
Size:	14.4 KB 
ID:	18284

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Why do you need to make a table? Why not just use the query and join to table B?

    Why don't you change the data type of field in table A?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jmracura is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Location
    California
    Posts
    3
    Thanks for the quick reply. Table A is read only so I can't change the data type there. I can't link to Table B because i need to link the ref_id (text) to the dep_id (number). Table B is also read only, hence why I was trying to convert one of the data types in a temporary table using the make table query function.

    Once I create the temp table, I can go in and manually change the data type. But I'll be setting this up to run as part of a macro and I don't know how to manually convert the data type in the temp table as part of my macro.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Incorporating process that routinely modifies db design is usually bad idea.

    Instead of make table, just manually create the 'temp' table with desired properties then run INSERT SELECT sql to append records. Then you can either routinely append and/or update records when necessary or purge the table and re-append all records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jmracura is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Location
    California
    Posts
    3

    Thumbs up

    Quote Originally Posted by June7 View Post
    Incorporating process that routinely modifies db design is usually bad idea.

    Instead of make table, just manually create the 'temp' table with desired properties then run INSERT SELECT sql to append records. Then you can either routinely append and/or update records when necessary or purge the table and re-append all records.

    Thanks June7. That totally worked. I don't know why I keep thinking I had to do it within the initial make table query, since I'm going to regularly update this table with new data. So long as I just do the insert into function (using the update table feature) in Access, i should be ok! I wish I had checked this site sooner... Google wasn't much help this time around.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-24-2013, 11:50 AM
  2. Replies: 2
    Last Post: 10-22-2012, 05:32 PM
  3. Replies: 5
    Last Post: 06-19-2012, 10:46 AM
  4. Replies: 1
    Last Post: 08-07-2011, 07:58 AM
  5. change data type in make table query
    By jgelpi16 in forum Queries
    Replies: 2
    Last Post: 01-26-2011, 09:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums