Results 1 to 5 of 5
  1. #1
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18

    Unhappy How can i add column data from one table to another without common field or primary key same rows#

    I got this table named Table7 and i need add the data of Table8 in the "CONSEC" blank field like manually copy/paste, but when i try to update query the Table8 data goes to the end of column after blank cells. I NEED HELP WITH SOME SQL CODE OR SOMETHING LIKE THAT, THANKS.

    Table8
    CONSEC
    0001
    0002
    0003
    0004
    0005

    Table7
    NO_PARTE TIPO NO_COMPNT CANTIDAD CONSEC FECHA_INI FECHA_FIN
    F18856200:TVSO-2017-3 P A2184654B 1


    9/23/2017
    F18856200:TVSO-2017-3 P A2165372A 1
    9/23/2017
    F18856200:TVSO-2017-3 P 872902914 5
    9/23/2017
    F18856200:TVSO-2017-3 P 859430270 1
    9/23/2017
    F18856200:TVSO-2017-3 P 768564779 2
    9/23/2017

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    databases don't work that way, they are not excel.

    Is the purpose of what you are trying to do to create a number for ordering of some sort? If so, then you need to use a technique called running sum. If this is in a report then that is available as report functionality. Otherwise you need to use a query and be aware that databases have no sense of order unless you give it one. With your data, the first two columns and date column have the same data in each row, so no order there, and the Cantidad has duplicate values in the rows, so you can't order that one either. Which leaves the no_compnt column which has unique values in each row - but perhaps in another example this would not be the case and you would have repeats and anyway, the order would be alphabetical, which is not the same order you have them at the moment - perhaps this doesn't matter or perhaps it does.

    So you need to clearly explain why you are trying to do this and perhaps we can help.

  3. #3
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18
    Thanks Ajax, the reason for this action is because i need modify a table from a linked program that contain a sequence number as text format, so i was created a table from that linked table and i can add or remove rows to update my data all this in an access form i created the sequence number with autonumber formated like "0000" and when i update the table run this function ALTER TABLE Table5 ALTER COLUMN CONSEC COUNTER (0001,1) to reset the autonumber and start in "0001" on top then i change the autonumber format with this, TextField: CStr([CONSEC]) and CONS: Format([TextField],"0000"), so then i create new table with follow function SELECT Table6.CONS AS CONSEC INTO Table8 on last i run a update query to make null the column that i want to fill whit my text autonumber that i been created. Thanks for your time.


    Quote Originally Posted by erickfloyd View Post
    i got this table named table7 and i need add the data of table8 in the "consec" blank field like manually copy/paste, but when i try to update query the table8 data goes to the end of column after blank cells. I need help with some sql code or something like that, thanks.

    Table8
    consec
    0001
    0002
    0003
    0004
    0005

    table7
    no_parte tipo no_compnt cantidad consec fecha_ini fecha_fin
    f18856200:tvso-2017-3 p a2184654b 1
    9/23/2017
    f18856200:tvso-2017-3 p a2165372a 1
    9/23/2017
    f18856200:tvso-2017-3 p 872902914 5
    9/23/2017
    f18856200:tvso-2017-3 p 859430270 1
    9/23/2017
    f18856200:tvso-2017-3 p 768564779 2
    9/23/2017

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    still not at all clear what you are trying to do. You say ' need modify a table from a linked program that contain a sequence number', why not just use that number?

    All you are telling me is how you created table consec, you are not telling my why you need to apply the number. Nor have you clarified the parameters I mentioned - to which I'll add, does table 7 have more than on part number?

    All I can tell you is that you cannot do what you want to do the way you are trying to do it. But to provide a more detailed suggestion other that the running sum already suggested, I need to know the parameters and why.

  5. #5
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18
    Ajax, Thanks a lot, when i try to explain tha procces I found the solution that I was loking for, after create my autonumber as a text i jus run the code SELECT Table6.NO_PARTE AS NO_PARTE, Table6.TIPO AS TIPO, Table6.NO_COMPNT AS NO_COMPNT, Table6.CANTIDAD AS CANTIDAD, Table6.CONS AS CONSEC, Table6.FECHA_INI AS FECHA_INI, Table6.FECHA_FIN AS FECHA_FIN, Table6.MERMA AS MERMA, Table6.CVE_UM AS CVE_UM, Table6.ASSEMBLY_ITEM_ID AS ASSEMBLY_ITEM_ID, Table6.ORGANIZATION_ID AS ORGANIZATION_ID, Table6.CONSECUTIVO AS CONSECUTIVO, Table6.LAST_SHIPMENT_PO_DATE AS LAST_SHIPMENT_PO_DATE, Table6.PO_NUMBER AS PO_NUMBER, Table6.PO_QTY_RECEIPT AS PO_QTY_RECEIPT, Table6.EFECTIVE_PO_DATE AS EFECTIVE_PO_DATE, Table6.ITEM AS ITEM, Table6.SOURCE_ORGANIZATION_ID AS SOURCE_ORGANIZATION_ID, Table6.DESCRIPCION AS DESCRIPCION, Table6.STATUS_MAKE_BUY AS STATUS_MAKE_BUY, Table6.QUATITY AS QUATITY, Table6.ITEM_CST AS ITEM_CST, Table6.EXT_MTL AS EXT_MTL, Table6.EXT_MOH AS EXT_MOH, Table6.EXT_RES AS EXT_RES, Table6.EXT_OH AS EXT_OH, Table6.EXT_OSP AS EXT_OSP, Table6.EXT_TOT AS EXT_TOT, Table6.SUBENSAMBLE AS SUBENSAMBLE, Table6.NIVEL AS NIVEL, Table6.SEGMENT1ERROR AS SEGMENT1ERROR, Table6.PO_PRICE_RECEIPT AS PO_PRICE_RECEIPT, Table6.RECEIPT_NUMBER AS RECEIPT_NUMBER, Table6.TIPO_IMP AS TIPO_IMP, Table6.FEC_TRASP AS FEC_TRASP, Table6.OSP_INDICATOR AS OSP_INDICATOR, Table6.FR_USA_EXP AS FR_USA_EXP, Table6.CVE_PAIS AS CVE_PAIS, Table6.REPACK AS REPACK, Table6.VENDOR_NUMBER AS VENDOR_NUMBER, Table6.VENDOR_NAME AS VENDOR_NAME, Table6.LOCK_MAN AS LOCK_MAN, Table6.LOCK_DESC AS LOCK_DESC, Table6.FEC_MAN AS FEC_MAN, Table6.FEC_DESC AS FEC_DESC, Table6.PORC_SCRAP AS PORC_SCRAP, Table6.FACTOR_UNI AS FACTOR_UNI INTO Table8FROM Table6;
    And then i make a update query and that works, now i can add or remove components keeping the sequence number as text format like my program source requires

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

Similar Threads

  1. Replies: 3
    Last Post: 04-13-2017, 09:47 AM
  2. Replies: 5
    Last Post: 08-25-2015, 08:39 AM
  3. Replies: 1
    Last Post: 03-16-2015, 11:06 AM
  4. Replies: 1
    Last Post: 07-30-2013, 06:33 AM
  5. Replies: 1
    Last Post: 06-01-2009, 01:09 PM

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