Hi.
I have two tables, t_transactions and temp_t_transactions. I created temp_t_transactions by copying the structure of t_transactions. Primary key is field "id_trans" and is an autonumber. Both are permanent tables.
I want the user to work on the temp_t_transactions table, and when ready, copy that info to t_transactions, which is the permanent database. When I try to run the following query, I keep getting an error message that says there it "didn't append 1 record to the table due to key violations". I am not including the key field for either table in the SQL code. This is the code. It works fine the first time I run it, when t_transactions is empty, but fails when it has even a single record.
INSERT INTO t_transactions ( id_trans_type, id_product, f_quantity, id_locación, effdate, actdate, id_user, id_po, id_so, id_inv, f_comments )
SELECT 'TRANSFER' AS f_trans_type, temp_t_transactions.id_product, temp_t_transactions.f_quantity, temp_t_transactions.id_locación, temp_t_transactions.effdate, Now() AS actdate, 'AFRANCO' AS id_user, temp_t_transactions.id_po, temp_t_transactions.id_so, temp_t_transactions.id_inv, temp_t_transactions.f_comments
FROM temp_t_transactions;
Any help will be greatly appreciated.
Thanks.
Armando.