Duplicate Records In Query To Join Fields From Several Imported Txt Files

Jan 10, 2008

Hi all,

I have the following issue:

In my job we work with several raw data .txt files exported from Oracle ERP system. These data include information about: inventory, sales, backorders, purchase orders, forecasts, product line.

My goal is to put information from all of these imported txt files together to create an easy to use snapshot file.

The common field between al of these files is the item description. I have an issue where records are repeated for several fields every time the same item description is showed. For example for the same product description the january sales forecast QTY is repeated on several rows because there are several orders for this product description. Is there a way to make forecast QTY appear only once but keep the multiple orders and their information?

Example of current result

http://img178.imageshack.us/img178/5659/currentsu7.th.png (http://img178.imageshack.us/my.php?image=currentsu7.png)

to achieve result

http://img179.imageshack.us/img179/5100/toachievefk4.th.png (http://img179.imageshack.us/my.php?image=toachievefk4.png)

thank you for any comments

View Replies


ADVERTISEMENT

Modules & VBA :: Change Ending Of All File Paths Of Imported Files

May 26, 2015

I'm currently looking to change the ending of all filepaths of imported files whenever I run the import. I want to change the path ending from .txt to .doc. So basically, the link/path to the file should be got, the ending changed from .txt to .doc and then the path (with the .doc ending) put into the table.

Code:
Private Sub bimportinternal_Click()
On Error Resume Next
strFolderPath = "S:Foo reportsSearchable"
strFolderPathSave = "S:Foo reportsSearchableArchiveword" & objF1.Name
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(strFolderPath)
Set objFiles = objFolder.files

[code]...

View 4 Replies View Related

Forms :: Function To Enable / Disable Button Depending On Files Imported Or Not

May 20, 2015

I have 3 macro importing 3 files, and then another button to process those data.

So, I need a function to enable/disable the button depending on the files have been imported or not.

View 1 Replies View Related

Creating Archive Table For 30 Days To Contain All Data Imported From Multiple Text Files?

Oct 30, 2014

i'm in the process of creating an Access database to import data in text files and then export the data as fixed width text files, this is now working fine

My next step is to be able to setup an "Archive" Table which will hold all the data i have imported across multiple import proceudres for the last 30 days, i then want to be able to "De-Dupe" any files i import against this to ensure i never load duplicate data.

View 1 Replies View Related

Modules & VBA :: Reading VCF Files - Fields Missing In Different Records

Mar 22, 2015

I have an application where I have to read a big VCF file in VBA, extract the information and place it into records of a table. Of course I can read as a text file, but the structure is quite cumbersome to implement with many fields missing in different records and it is not a one time job.

View 1 Replies View Related

Prevent Duplicate Records Based On Multiple Fields

Nov 15, 2005

how or what function (DLookup) should I use to prevent duplicate records based on multiple fields? I want to look at data in three fields that can't match existing data in those three fields. It's ok if one or two of the fields match but not all three.

View 2 Replies View Related

Queries :: Find Duplicate Records In Table With Two Fields

Aug 29, 2013

I want query to find duplicate records, i have two field in one table

Cusip and category

cusip and category are many or duplicates

but in one cusip category should be the same if not then provide the cusip which has different category used

like this
CusipCategory
123R
456P
123R
456P
678Q
678Q
123A

result should be

CusipCategory
123R
123R
123A

View 6 Replies View Related

Modules & VBA :: Import Csv Files And Rename Them After Import Into (imported) And (failed)

Jul 17, 2015

I have the following piece of code for importing the .csv files from a selected folder and then renaming them into 'imported & filename' if succesful and 'failed & filename' if import failes for whatever reason (bad formating, etc.).

The problem is that the first time it encounters a 'bad' file after another, instead of going again to the Error handler, the command

Code:
DoCmd.TransferText acImportDelim, , "Activitate", filename, True

gives me the default MS Access error, namely 2391. I would like it to go the the Error_handler again ang follow the course of actions and rename the files into 'failed' and 'imported'.

Here's the code:

Sub ImportActivitate()
Dim strFile As String 'Filename's
Dim strFileList() As String ' File Array
Dim intFile As Integer 'Number of files
Dim filename As String, sFullName As String, sFilename As String
DoCmd.SetWarnings False

[code]....

Also, how can I make the routine stop cycling through the files after I renamed them all?

View 3 Replies View Related

Queries :: Join Fields Query

Jul 28, 2013

I tried doing a search but couldnt find the i needed.

Category_name Sku
cars 1
Trucks 1
Bikes 1
Phones 2
Tablets 2
Hats 3

and what i need to is something that will link all sku 1 category names in a new field with a | divider and then all the sku 2 category names together with | as a divider and so on. the amount of categories is different for every sku.

so it looks like this

Joined_categories sku
Cars|Trucks|Bikes 1
Phones|Tablets 2
Hats 3

And if this is easy enough, its not that important though but to delete duplicate category names when it transfers them across to a new field joined together.

View 14 Replies View Related

Importing SAP Text Files And Join Help

May 27, 2005

I imported a table into Access from a SAP generated text file. The integrity of the data is fine after import. I then created a new table from the original that has the exact same amount of records and has the same unique field, which is MATERIAL. The problem I have is when I join the two tables in a query, Access returns approx 140,000 records. I am doing a regular join, what could be the problem? Is it possible the table data types are not formated correctly, b.c I imported them all as text so Access would import all lines.

I look forward to anyone's response.

TIA

Ease

View 1 Replies View Related

Edit Fields In An Outer Join Query

Mar 13, 2008

I have 2 tables (tblItemsQB and tblItemInfo) that have a 1 to 1 relationship linked by the "PartNumber" field. The tblItemsQB table contains a description field and 2 price fields (this table is downloaded from Quickbooks). The tblItemInfo table contains additional fields with information on the part that isn't contained in Quickbooks, like OrderType, Phase, SubSystem.

I import the items from QB into tblItemsQB and then do an outer join with tblItemInfo to link all the information for the part. If I have created a new part in Quickbooks, when I do the outer join (I include all records from tblItemsQB) I can see the new part but since the part number doesn't exist yet in tblItemInfo, I can't add the information to the fields in that table.

What is the easiest way to create the new PartNumbers (those that exist in tblItemsQb but not in tblItemInfo) in the tblItemInfo table so I can add the other information to it?

thanks
mike

View 2 Replies View Related

Can't Modify Fields In Form With Table INNER JOIN Query

Oct 5, 2004

Hello, exactly how Access 2002 and SQL operate is still a bit fuzzy to me.

In brief:
tableAccounts has fields for Signatory1ID and Signatory2ID, and other stuff
tableSignatories has ID for a primary key and has SignatoryTypeID as a field
tableSignatoryTypes has ID for a primary key and SignatoryType as a field

For each account, on a Form I want to show the Signatory and SignatoryType info for both signatory1 and signatory2. I have tried creating various queries and INNER JOINing the tables and/or queries together, but whenever I manage to get all the information displayed, none of it is editable. Access seems to lock the various text boxes and combo boxes.

Any thoughts?

View 2 Replies View Related

Query Multiple Tables Using INNER JOIN And Multivalue Fields

Jan 28, 2013

Here is my current table structure (I have omitted some fields from this example and have given some sample data in italics to make the table structure more clear.

tblEmployees

ID (autonumber) 3
EmployeeName John
EmployeePhone 555999555
EmployeeLocation New York

tblClients

ClientID (autonumber) 1 , 2 , 3
ClientName ABC Company , XYZ Company, PQR Company
fkeyLocationID

tblLocations
LocationID 1 , 2
Location New York , Chicago

tblEmployeeClients (junction table)
fkeyID 3
EmployeeClients (multivalued number) 1,2

The junction table tblEmployeeClients only stores ID of the Employee and in the second column (which is a multi-valued field), the ID of each of the clients the employee Supports.

I am trying to generate a report that lists say, EmployeeName alongside the clients supported by the Employee (listing the client location is not required, however, it would be good to know how to do that as well).

The report (for the example above), should look like this:

Name Clients Supported
John ABC Company, PQR Company

Currently, I am able to get :

John 1, 2 i.e the client ID for the clients that the employee supports instead of the corresponding company names.

View 1 Replies View Related

Inner Join Returns Duplicate Entries?

Aug 29, 2007

I'm using a pretty simple inner join on two tables but the some of the same results are showing up twice. If I just remove the inner join all the results are uniquely present. For some reason the inner join creates about 10% more records that are all duplicate entries. Any idea what might cause this? :confused:SELECT products.product_nameFROM products INNER JOIN categories ON products.category = categories.category_nameWHERE ((products.X)=True);

View 2 Replies View Related

Queries :: Update Query - Add Records To A Join Table?

Apr 11, 2013

I have 2 tables that are joined by a many to many table:

tblProductInfo
- ProductID

tblProductLinerMM

- PLProductID (FK to [tblProductInfo].[ProductID])
- PLLinerID (FK to [tblLiner].[LinerID])

tblLiner

- LinerID

I have a range of products that each use 2 liners. An inner liner and an outer liner. I need to add 2 records per product to the tblProductLinerMM table.

for example

tblProductInfo has the following records:

- 2138557
- 2378954
- 4387657

tblLiner has 2 liners in particular that relate to these products:

- L5475
- L5468

I need to create the following records in tblProductLinerMM preferably with the use of a query :

- 2138557 | L5475
- 2138557 | L5468
- 2378954 | L5475
- 2378954 | L5468
- 4387657 | L5475
- 4387657 | L5468

View 1 Replies View Related

Modules & VBA :: How To Filter Imported Records

Jun 3, 2015

I am importing about 1.5 million records from a .txt file into an Access database. I have the code that splits the records and adds them to the database. However, the database has a 'specialty' table that lists certain specialty codes. The incoming record has a field that is a specialty code. Any way to search the 'specialty' table for the code that is coming in on the record to be added, and then, if the record 'code' is not found, skip it, and if it is found, add it to the database. There are about 70 codes in the 'specialty' table.

View 9 Replies View Related

Query Using Joins To Disply All Records From Both Sides Of Join Type

Apr 14, 2008

I have a list of PC SN#s in tbl1;
I have a list of other PC SN#s in tbl2
I want to display ALL records of tbl1, AND ALL records of tbl2, matching up the SN#s (where there is a match) - but I want to display all records whether they match or not.

How can I accomplish this?

View 1 Replies View Related

Excluding Deleted Records From An Imported Table

Jun 6, 2007

Hi

I have a table that I am importing from FOXPRO DATABASE. When someone goes into the system and deletes a record, Foxpro does not really delete the records but marks it for deletion. There is no field to query on that I can see in the table, but when I go to Foxpro the record is "marked" for deletion.

Anyway to exclude these records when doing a query or importing the table?

Thanks

View 1 Replies View Related

Queries :: Nested Query - Left Outer Join Not Returning All Records

Oct 1, 2014

I have a simple nested query that is not working as expected. My inner query returns 102 records but when I run with outer query I only get 96 records. Below is my query, I don't really want to pull the same fields from both tables but I was doing to test. The values that are missing are those that don't exist with the monthenddate 8/31/2014 - a left join should fix that but doesn't seem to be working ..

Code:

Select distinct a.entity, a.gl_account,a.profit_center,[Open Items_1].profit_center,[Open Items_1].gl_account,[Open Items_1].entity
from(
SELECT DISTINCT [Open Items].entity, [Open Items].gl_account, [Open Items].profit_center
FROM [Open Items]
)a
left outer JOIN [Open Items] AS [Open Items_1] ON
(a.profit_center = [Open Items_1].profit_center) AND (a.gl_account = [Open Items_1].gl_account) AND (a.entity = [Open Items_1].entity)
Where ([Open Items_1].MonthEndDate=#8/31/2014#)

View 1 Replies View Related

Queries :: Left Join Query To Show Records That Fulfill Two Criteria

Mar 25, 2014

I have two queries. The unique key in both queries is GUID for katalogposition.

One is showing me records which has an product end date (Produkt slut dato) between today and end date of next month. This query works fine and is called q_termination.

The second one shows me unmatched records in the first query (q_termination). The query works fine and is called yq_NonTermination.

The goal is now to show me records from the first query "q_termination" that fullfill one of two criterias.

1. No match in second query "yq_NonTermination"
2. Match BUT product end date (Produkt slut dato) is greater than the match in "yq_NonTermination".

I have made a left join query on the field "Dublet_Lagervarer". From the join query the goal is to show me only q_Termination.Guid for Katalogposition number 47 and 134008.

How can I do that? Is there another way to do it? Please see attachment.

View 3 Replies View Related

Query For Duplicate Records

Jul 9, 2007

I am creating an ordering system which comprises of amongst others, these fields:

ID
OrderHdr
OrderLine

I want to ensure that if a user enters an ID, OrderHdr and OrderLine that this combination does not already exist elsewhere within the same table.

I have written a query like this:

COUNT OrderLineDetails.id, OrderLineDetails.orderno, OrderLineDetails.orderline
FROM OrderLineDetails
WHERE (((OrderLineDetails.id)=?) AND ((OrderLineDetails.orderno)=?) AND ((OrderLineDetails.orderline)<>?));

I will be replacing the "?" with the relevant form fields from the form, but how do I run the query and store the result in a variable and prevent the user from carrying on until they change any of the fields until there is no duplication.

View 3 Replies View Related

Tables :: Import Excel Into Table / Overwrite Data Of Fields Imported

Mar 17, 2015

I have a table, which contains many fields, around 90. Out of these 90 Fields, around 40 will be imported from an Excel sheet, which has same headers as the 40 field names in my table, in which they have to get copied.

So when I import data, it copies them as new records, instead what I am looking at is, the records in Excel and in Access table has a Unique Key, so when I import data, matching with this unique key, the fields should be overwritten into those records from Excel, instead of adding new records.

E.g:

Say I have 2 records in my access:

ID(auto generated) Fab_name Issue_ID Location Remarks Data_1 Data_2 Data_3
1 Fab1 193 NY Bug OC DC MC
2 Fab2 641 DRS Error AC KC FC

Now when I am importing data from Excel with the following records:

Fab_name Issue_ID Location Remarks
Fab1 193 NY - GRM Solved
Fab2 641 DRS - SGP Forwarded

So when I import the above data into my Access from Excel, based on Issue ID, it should update the values of different fields that are imported from Excel, leaving other fields (data_1, Data_2, Data_3) as it is.

And I need this to be written as a macro, so that user just has to choose the file, which he has to import.

View 6 Replies View Related

Merging Data From Duplicate Database Files

Mar 18, 2015

We have a client who has managed to muck up their Access database by means of having two users on two computers attempting to use and modify it at the same time, and the primary (actually, the only) location for the database is on Dropbox.

What seems to have happened is that Dropbox detected a conflict, with two different versions of the same file, and resolved this by creating two separate files. How long this went on before the client noticed that they were entering data into two separate files, I can't say.

Their client list is 28,000 someodd people long. What I need to know is if there's a process for merging the two files together, without creating 28,000 duplicate entries. This is being run on Access 2002.

View 2 Replies View Related

Filter/ Sort Query To Eliminate Duplicate Fields

Apr 6, 2006

Basically i have a mortgage application system which im running a query on to see which applications have been completed in the last week or period up to now ie. last week, last month, last 3 months.

basically each application or CaseID has one or more applicants. The majority of them have two applicants. A few have one.

Problem is when i run this query which shows me: - CaseID, CLIENTNAME, LENDER, PRODUCT, MORTGAGE RATE, LOAN AMOUNT -

it brings up these fields but i only want one occurence of each CaseID????

CaseID Forenames Surnames PRODUCT RATEDateCompletedLoan required
2821NothandoDube71116.6920/01/2004£63k
2821Sipho Dube 711 16.69 20/01/2004 £63k
2909Hobbly Chise 726 15.69 31/01/2002 £164k

Get the picture? Both Sipho and Nothando are applicants on the same mortgage but i only want to show one name. Anybody know how to help me out???

Ive taken up this existing system, so i think there's possibly a normalisation problem thats causing this. But i need a quick fix for now rather than redesign the whole system.

View 2 Replies View Related

Help Filtering Duplicate Records From Query

Nov 28, 2007

Dear Experts,
I have created a database with queries that is working fine, however there are many records that have the same information that can not be removed easily, is there a method anyone knows of that can filter the records produced from a query to remove duplicates? i.e. 'select distinct' but for the whole query after the search parameters have been entered.

e.g. the search query is producing, after the refined search values are entered:
414353p - Fiat - 1.6 - MLS
414353p - Fiat - 1.6 - MLS
How can i then apply a filter to automatically reduce these duplicates to just one entry for the whole form?

Thanks

View 6 Replies View Related

Eliminate Duplicate Records In A Query

Jun 5, 2007

I know there a many posts about eliminating duplicate records because I did search, but I did not see anything that really answers my question.

I have a query in a local Access database that is using a Linked table from an SQL database managed by our corporate IT department. I have read access to only certain tables / fields in the SQL database. My query is based on 3 tables from the database and I have them linked together in my query.

When managers move from one site to another, they are given a different TeamID number. However, until they are replaced, the manager will have more than one TeamID assigned to him in the SQL database. Evidentally, the way our IT has the SQL database structured, when I query open items it duplicates the record for that manager because he has 2 TeamID numbers. So the only field that comes up differnt in the duplicate records is the manager's TeamID number.

I would like for my Select Query to ignore the duplicate record. I know I can use an Append Query to copy the data temporarily to a local table and set the proper fields as Primary Keys to do this. However, it would be nice if I did not have to go to all that trouble.

Is there a way to eliminate duplicate in my Select Query?

As always, I appreciate the help.

Jim

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved