Table query help

KenshiroUK

Registered User.
Local time
Today, 13:43
Joined
Oct 15, 2012
Messages
160
Okay, so I'm wanting to create a query that takes new products from a text file and adds them into an existing table to update.

So far I have linked a text file into my database and I have created the table. Looking for the SQL code.

could somebody help me please?
 
Need some help from you. What are your fields in your table and which ones do you want to extract. You haven't given us much to go on. Perhaps a quick tutorial on building queries. Look here

http://www.databasedev.co.uk/queries.html


okay tables are SKU, Title, standard-product-id, product-id-type, product_type.

So basically I keep getting text files, now I want to run a query that takes data from those titles in the text file and updates my main inventory file. My table is called inventory table and my text files will be new products.
 
I'm still not sure what is happening here. Let me see if I understand. You are importing a text file that contains the following fields into a table.
SKU
Title
Standard-Prouct-id
product-id-type
product-type

You now want to add this data to another existing table. All the data or only some of it?

If this is what is happening, then you will need to create an append query. If you are doing something else, please provide details of what steps you are taking and specifically what you are doing.

Your current explanation is to vague to provide a solution.
 
okay I have a table in Access called Inventory with the follow titles Sku, Standard Product ID, Mfr Part Num, count, item price, currency.

We regularly get reports in a delimited txt file. I wish to create a query that looks at the txt file and takes the data found under the titles Sku, Standard Product ID, Mfr Part Num, count, item price, currency from the txt file and adds it into my Inventory table.
 
I think it may have something to do with an append function?
 
okay I have a table in Access called Inventory with the follow titles Sku, Standard Product ID, Mfr Part Num, count, item price, currency.

We regularly get reports in a delimited txt file. I wish to create a query that looks at the txt file and takes the data found under the titles Sku, Standard Product ID, Mfr Part Num, count, item price, currency from the txt file and adds it into my Inventory table.




I would like to help you, but I am not sure that I fully understand your problem. I created a new Database did the following:
  • Created an Access Table with Felds for Sku, StandardProductID, MfrPartNum, PartsCount, ItemPrice, and CurrencyType (Note the change of Field Names to eliminate Spaces and Access Reserved Words)
  • Created a standard Text File containing two lines of data to be inserted into the Table.
  • Linked the Text file as a new Access Table
Once I did this, I was able to use the Standard Query Builder to create an Update Query which imported the data from the Linked Table to the Main Table.

What is not working for you?

-- Rookie
 
I am not sure that I fully understand your problem. I created a new Database did the following:
  • Created an Access Table with Felds for Sku, StandardProductID, MfrPartNum, PartsCount, ItemPrice, CurrencyType (Note the change of Field Names to eliminate Spaces and Access Reserved Words}
  • Created a standard Text File containing two lines of data to be inserted into the Table.
  • Linked the Text file as a new Access Table
Once I did this, I was able to use the Standard Query Builder to create an Update Query which imported the data from the Linked Table to the Main Table.

What is not working for you?

-- Rookie


The problem is I don't actually know anything about Access, I've just been thrown into the deep end.
 
The problem is I don't actually know anything about Access, I've just been thrown into the deep end.

You said "I have linked a text file into my database ", and I assume that means you have used MS Access to create a Linked Table that is connected to the Text File. I do not know what version of Access you are using, but in all versions the task is the same, with the method possible being a little different. Using Access 2003, I did the following
  • Create a new Query using the Query Designer
  • Select the Imported Table and choose the Fields that need to be appended to the Main Table.
  • Convert the Query from a Select Query to an Append Query.
  • Enter the Name of the Table to Append to.
Running the Query should get what you are looking for.
 

Users who are viewing this thread

Back
Top Bottom