i have ms access query with several fields and columns, some of the data in the tables that I query shows up multiple times. I would Like to eliminate duplicates based on 4 columns - if this 4 columns are identical in more rows I would like them to be displayed only one time. Is this possible?
See attached example:
the first 2 entries should be consolidated into 1 entry.
Br,
I found a simple solution for this - What I needed to do is to change the property in the Query Design "Unique Values: Yes"
Related
I have a query which combines different tables without any link so it create combination .Numbers of records has reached 20 Million , I have sorted these records by one field . MS Access hangs and stops working .Please anyone who can help in speeding up query or make it working.Thanks
Combining tables without telling the query how to relate one table to another is called a "cross join" as you say it creates a combination of the records.
It's easy to get very large results using a cross join, just 5000 rows in each of two tables in a cross join will generate 25 million records, just 300 records in each of three tables will give 27 million. With just 5000 or 300 records per table MSAccess will fly, but asking it to run a query to create ~20M records will take time, that's just how it is.
I suggest you tell us what you are trying to do, I expect that there should be a relationship between the tables, or at least something in the query to tell MSAccess which of the 20M records you want to see. I expect you don't want to scroll through 500000 or so pages of data to find what you are looking for.
One method would be to change your query to a create-table query using no filters.
Then create indexes in the new table on the fields you wish to filter on.
Now, use this table as source in a query where you apply the filters you wish.
I am a newbie with access and I am trying to import records into several tables from an excel file. Each row in excel has different number of columns, but the good thing is column A is able to help me to identify what records need to go to my different tables.
Sample table
As you can see in the picture, Row 1 Column A has the value of "H", which would indicate that this record needs to go to the "H" table. Then the next few rows have a value of "R" in Column A which indicates that these records should go to the "R" table, and so on and so forth. However, the number of records to be imported into each table will vary all the time. Like the sample above rows 2 through 10 belong to the table R, but the next import may have only 5 or 20 records.
Currently I am using a temporary table and using an append query for each table but I am wondering if there is an easier way via VBA or other method that could be faster and more efficient.
Thanks!
The way you are doing it now may be the best way. An alternative would be to do this in two steps:
1) split your column A, and parse out to different sheets (or different workbooks).
http://www.rondebruin.nl/win/s3/win006.htm
2) load those different sheets (or workbooks) into different tables.
http://www.accessmvp.com/KDSnell/EXCEL_Import.htm#ImpAllWktsSepTbl
http://www.accessmvp.com/KDSnell/EXCEL_Import.htm#ImpFldWrkFiles
I must be missing something very obvious!
If I have a simple query (SELECT * FROM Table) which has 200 columns - rather than dragging each of my dataset columns onto my table object in design mode, is there any way to have those 200 columns auto built to that table, or a new table? THE CATCH IS - I don't want to do any grouping, summing, etc.. Just a flat table.
** IF I try to use the Table Wizard, it eventually brings me to that "Arrange Fields" box which provides Column groups, Row groups and Values. I only want "Columns" generated, not any kind of Matrix grouping. Just a flat table, so if my dataset returns 1000 rows, I want a table that has 200 columns, and 1000 rows.
Is this not possible in Report Builder? I'm completely stumped!! Help very much appreciated. Thanks!
The wizard WILL do exactly what you're looking for - when you get to the page in the wizard with the 3 boxes (row/column groups + details), just put all of your fields into the Details box - neither of the grouping boxes are required fields.
Leave the formatting alone on the following page, and you're set.
I have a series of tables in an Access 2007 database. I am trying to find a way of outputting a flat-file to an excel spreadsheet that combines all of the tables so that each row of the flatfile represents a unique combination of the table rows from each table.
For example, these tables:
Would combine to make this output table:
The challenges I'm facing are:
The 'input' tables can vary in number of rows and columns, as well as quantity
The total number of rows in the final output table can get quite large (200,000+ rows)
I know Excel and VBA (in Excel) well but almost nothing about Access
Is there a way to do this in Access? Is there some native functionality in Access that I'm completely overlooking? Any pointers (even if it's "you need to read into X and Y") would be greatly appreciated!
Thanks,
Adam
As noted above:
Create a new query. Select your 3 tables as the data sources. If desired, set up joins between tables by dragging a line between a field in one table to a field in another. Without joins you will get a Cartesian Product ... every from 1st table paired with every row of 2nd table, and then each of those combination paired with every row of 3rd table. Select the fields you want included in the result set. When the query returns what you need, save it and give it a name. Then you can export that named query to Excel.
If the table is large, you could hit Excel's row / column limit though.
I am trying to develop a report having two tables with one single data set.each table is filtered with the user giving a date parameter. is there any way that I can get the value present in a text of table1 into the table 2.
If you have a report with two table objects in it, both of which point at the same dataset, then all of the data in either table will be available in the other table - the only reason that one value would be available in one table but not the other is if the tables have different filter conditions. Therefore, you may need to amend the filter conditions.