I am making a table by combining columns of two tables. But there are few duplicate rows also. How do you delete duplicate rows from MS Access. I tried using the duplicate record query and also tried to use append query. But neither of them worked.
There are a couple of ways you can do this without using the Access wizards:
1. Run a Make Table Query and in the select statement use grouping for every column. If the tables have a unique ID, don't use the ID because that will make every record unique
2. Export a Select query with the columns you want from the two tables to an Excel workbook. Once in Excel go to the Data tab and click on the column header selector and click on the Remove Duplicates button. Make sure you expand the selection if it asks you. Then save and link the Excel Workbook to Access again and do whatever you need to do from there
There are more ways, but you'd have to provide more details as to what you're trying to accomplish
Related
I am very new to MS Access and I don't even know how should I start to approach for the solution.
I have a Table 1, that contains Project No., Part No. and Quantity of parts.
Now I want to transfer this data on button click to two different tables.
Table Order and Table Parts.
Table parts is a sub table of Table Orders
When we add project Number to table Orders, then we get auto-generated ID then based on that Unique ID, Table Parts is linked to it.
As we get ID from Table Orders, we need to create entry into table Parts with that ID that will contain Part Number and Quantity.
Can you please help me this?
I tried creating an append query but its just adding Project to Table Orders, not doing anything with Part No. and Quantity.
I was using a view (VW_NEW_CUSTOMERS) in Teradata and all the column names had an underscore in it. The column names in tableau did not contain underscores.
For example:
Customer_Number (From Table View)
Customer Number (From Tableau Column Name)
Now I created a duplicate of the view (VW_NEW_CUSTOMERS_2), all the columns have the underscore in Tableau. So when I use replace data sources, the column name mapping is completely different from the above because of the underscores.
New Tableau fields from duplicated View:
Customer_Number (From Table View)
Customer_Number (From Tableau Column Name)
I would like to know why the underscores did not appear 1st time and it is now appearing when I duplicated the view. How can I rename the fields so that it comes like the 1st time? Should I do them manually now?
Note: Database columns were using aliases
Check this thread, this isn't new, Tableau decided to start renaming fields some time ago. Not sure why it would have done on one of your data sources, but not the other.
Anyway, the exec summary, you may need to reset the field names of the version without the underscore, which should bring the underscore back into your data, making both data sources the same. To do this, copied from the thread:
"Version 9.3 and 10.1, you can select all the measures (and dimensions) in a worksheet, right click and "reset names" in two operations"
I think there's also a way to hack the xml to add the spaces to your copy, should that be preferrable. The thread covers hacking the xml to remove spaces, therefore I assume to add spaces do the same but in reverse.
I have this code for the text box Control Source in Access:
=DLookUp("[Lot Number]","[Lot Number Generator Table Query]")
but that will only display the first row generated in the query. I need to get the latest one generated displayed. I've tried switching the ascending/descending order with no change.
Assuming LotNumber is sequential and that there are two tables to consider, try:
=DLookUp("[Lot Number]","[Lot Number Generator Table Query]","[Lot Number]=" &
Dmax("[Lot Number]","[Some Table]"))
Or much more simply, if there is only one table:
=Dmax("[Lot Number]","[Lot Number Generator Table Query]")
This is not safe in a multiuser environment or when Lot Number is an autonumber.
See also Domain Aggregate Functions
Im using Asp.net (VB.net), in my Database :
have One table called (Trade), the same rows of this table are used from 3 different users, These users can make different updates on this table, they should see the basic informations of the table (I mean by the Basic, before the table (trade) has been updated)
The problem is here when the first user wants to modify the table's rows, the second and third user cannot see the basic information any more, and if they decide to change or update some data, the first will lose his updated rows..
The data will be overwritten every time the users make updates on the table.
What I want, is to know if there is a way to do like a copy, or an image of the table for the 3 users, and every user can update normally, without creating the same Table with the same rows 3 times??!
Update
My table structure is: Trade(trName, Carrier, POl, POD, Vgp, Qgp) There is no primary key..
Thank you..
Solution to your problem could be two copies of the original table. Show the original table always to the user as the initial data. And in second table keep the updated data always. Now the trick comes here to maintain the log, for that you have to maintain the log table, this table will have all the fields of original table along with one additional column "UserId", this will have the ID of user who has changed the value. Now each time before updating the data, copy it in the log table. If this suits your need then post the fields of your table then we can workout on the table structures.
I need all my data of datatable into a excel,but i don't want to use the for loop to write line by line.Because if the rows are 200 or more it is taking time.
IS there any fastest way to do it.
fastest way I know of is to got to the data tab: get external data, create a connection to the database using ODBC or whatever, and then select the table you want per sheet. it will run the a query and get all data based on the query or table specified.
You can then right click on the data section and refrehs the data anytime you want OR you can set the data to refresh on open, sheet activate etc.
This is a "PULL" approach as opposed to a PUSH approach others are discussing.