General :: Get Totals From Column Containing Duplicates
Aug 5, 2015
I have a table that has a column of Equipment Numbers (e.g. CN330) and another column with corresponding costs. The Equipment Numbers are not unique. A number may appear many times in the column and the cost may be different each time. (The source data for this is an Excel spreadsheet provided by another department).
I need the totals for each unique Equipment Number but not in a "messy" format like subtotals. I need to use it as a lookup for another part of my database so want just two columns; unique Equipment Numbers in the first column and the total cost for each in the next column.
I have the unique Equipment Numbers in the first column of a new table but cant figure out how to get the total costs.
I have a query that lists three columns, is there any way I can have a total at the bottom of each columm? I Need to show the total for each column in my report.
I have a table with revenue by contract imported from crystal reports. This data is then thrown in a query to match the contract with the corresponding account rep. The query is set to prompt the end user to enter the account rep name so that only revenue (and related data) is shown for that specific account rep. All that works great. My problem is that I need to show column totals by account rep in the query so that it can be exported to excel and emailed to each individual account rep on a weekly basis. Can someone please help me?
I have a rather simple query that shows the number of layoffs in a given period and would like to know if I can have the query sum the numbers.
Company City Date Incident Laid-Off CompanyABC CityABC 5/3/2007 Mass Layoff 207 CompanyKLM CityKLM 5/5/2007 Mass Layoff 54 CompanyQRS CityQRS 5/7/2007 Plant Closing 436 CompanyXYZ CityXYZ 5/9/2007 Plant Closing 75
Is it possible to somehow display the total (772) underneath the "Laid-Off" column? Or create a separate column that only displays the "Laid-Off" total?
Or would it be easier to just build a report from the query and display laid off totals on the report?
(I apologize for the "table." I tried to import the query results as an image but couldn't get it to work.)
My problem is if there is no FaultTotals nothing shows up. I would still like for the Four Columns to show data and have a 0 in the FaultTotals.
How can I accomplish this?
In a nutshell I am totaling all Cosmetic Faults based on the SystemGroup CTWT and a Date Range. If there are no Cosmetic CTWT Faults for the DateRange I want a zero. The query works great as long as there is at least One FaultTotal for the Date Range.
SELECT "1-3" AS Truck, "Cosmetic" AS Category, WorkUnitsFaultsMainTBL.SystemGroup, Count(*) AS FaultTotals FROM WorkUnitsFaultsMainTBL WHERE (((WorkUnitsFaultsMainTBL.FaultCategory)="Cosmetic") AND ((WorkUnitsFaultsMainTBL.TodaysDate) Between [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt]) AND ((WorkUnitsFaultsMainTBL.BuildID) In ("E010","C809","F001","C810","F187","A910","M173","M174"))) GROUP BY WorkUnitsFaultsMainTBL.SystemGroup HAVING (((WorkUnitsFaultsMainTBL.SystemGroup)="CtWT")) ORDER BY Count(*) DESC;
I'm trying to create a query to work out the total amount to invoice based upon some selections. Currently my query looks at the values in several fields (numberOfRollsUsed etc) by taking the value in these fields and multiplying by a fixed amount to calculate the total.
What I would like to add to the query is fixed values based upon some check box selections. So if check box A is selected, add 5 to the total, is check box B is selected, add a further 10, and so on. All fields and check boxes are held within the same table (Job).
Am I being daft or trying to do something in the worst way possible? I'm actually adding this to an existing system so I don't have so many options to completely redesign the system to calculate this in a better way.
I have a database which has a table for the quotes prepared, each record has a quote amount. In a query linked to that table I have the ability to get just a specific month view which shows all totals in that month. I want to calculate a grand total for the amounts shown in quote amount:
Record 1 : 100.00 Record 2 : 100.00 Record 3 : 50.00
Grand total : 250.00
Then I want to display this grand total on a form which is visable on a screen based in the office that has an auto refresh on it so after 2 minutes any new records added to the table will increase the grand total on the form on the screen.
I have worked out how to do the totals bit, but now I need getting this figure (I.e. 250.00) on a form without having to run the query and have it looking in the background.
Is it possible to set up a view within an access app to show a number of different "grand totals", related to one or more tables. For example, I'd like to display the total value of all orders, the total number of orders and the total number of items ordered, on a single view. In this case, all the information comes from one table - Orders, which contains fields - Total Cost and Quantity. I've tried to create a Summary view, but that requires me to use the "Group By" function, which I don't want here, so I tried to do it with queries, but it seems to involve multiple queries, which then means multiple views.
I have set up this database here for my new sole trader business. In it I enter data of my purchases and my gross sales. I have generated 2 queries both based on the same tables. 1 calculates the purchases and the other the sales.
I want to be able to subtract the purchases from the sales so that I can see my profit at any point in time.
The complication is brought on I think from the fact that I am using one table for both Purchasing and Sales. However, I use a filtering method to separate the two.
Access 2007 - I am using the oft used, frequently posted and shard code from srfreemen - modified as below. now I know I sort of broke commandment # 8 - Thou shalt not copy and paste other people's code without at least attempting to understand what it does. but I honestly did try to understand what it does.
I keep getting runtime error 3078 - cannot find the input table or query 'tblEnrolment_Committee_Master'. It is the name of a table in my database but I am missing the very basic element of how to get my form (which draws all of it's fields from that table) to look it up or identify it.
Likely because of a silly basic error. Normally - I wouldn't attempt such things but my work needs me to ensure no duplicates exist in this case AND it's already a primary key - but I don't want to wait until the whole form is filled out for it to identify the duplicate!
How to get the tblEnrolment_Committee_Master to be included in the search and erase this error ...
Private Sub Entitlement_File_Number_BeforeUpdate(Cancel As Integer) Dim SID As String Dim stLinkCriteria As String Dim rsc As DAO.Recordset Set rsc = Me.RecordsetClone
I am trying to obtain totals from two columns in the list box into text boxes on the main form, but my third argument is not working as expected.The source of one of the tex boxes is:
Hey all! This is my first post. Been searching through the net all day trying to find a solution to this problem. Basically i have a table that looks like this (regular text is what i have and bolded text is what I need:Name Date Qty MOBrad 12/12/2007 23323 4423John 12/11/2007 3445 4432 John 12/11/2007 344 4432 John 12/11/2007 45 4432 John 12/11/2007 44 4432 John 12/11/2007 3445 4432 Grand Total: (Qty)And then I'd like to be able to carry this over and display a grand total at the bottom of every page of a report that I would need to generate. Our company produces forms and we sometimes have 60 - 70 people working on a single job. We want to see their hours individually but we would also like to see a grand sum of all their hours. If someone could help with this or needs more info let me know. Thanks for all your help!
I know there is no more than 4 dups of each record.
what i want from this is a table that will give me a record of how many dups for each record then all the dates that they were added and the date between each record entry.
Hey, all! Thanks for helping, here is my situation.
I have a table with about 70,000 records that have duplicate Address field values. The rest of the field values for those records are different. When I do a find duplicate querry I get the result that 17,000 records have the same address. However, when I do the append qurrey as instructed here: http://support.microsoft.com/?kbid=209183 I get a total of only 600 records in the new table. I have tried deleting all of the indexes for both the new and old table, with no luck.
I'm using Access 2000 on XP Pro.
If anyone could help with this I would greatly appreciate it!
I am trying to add a value to a column in a query based on the value of another column.
I am using an iif statement for it but can't get it to work. I have a column called [Was Worker Born in UK] which has 3 options of "Yes, "No" and "Unknown". The next column is the [COUNTRYOFBIRTH] column.
I basically want [COUNTRYOFBIRTH] to say "866" if [Was Worker Born in UK] is "Yes".
I have 2 Table that I will like to search in. I want to be able to search on a date and get the “ID” and the name of the column the date was found. Is that possible? I am thinking some kind of a Search-box, that will give a table/report.
The names of the tables are “2_PT_datoer” and “2_PT_CG_datoer”
In the first I want to search in the columns: “2U_PT-O_sendes(udfyldes_automatisk)”, “2U_PT-O_rykker_sendes(udfyldes_automatisk)”, ““4U_PT-O_sendes(udfyldes_automatisk)”, “4U_PT-O_rykker_sendes(udfyldes_automatisk)”, “8U_PT-O_sendes(udfyldes_automatisk)”, “8U_PT-O_rykker_sendes(udfyldes_automatisk)”, “6M_PT-O_sendes(udfyldes_automatisk)”, “6M_PT-O_rykker_sendes(udfyldes_automatisk)”.
In “2_PT_CG_datoer” I want to search in the columns: “Tjek_at_blodprove_er_taget_1(udfyldes_automatisk) ”, ”2U_CG-O_sendes(udfyldes_automatisk)” etc.
NB: I need an explanation for dummies as I am new to Access/Sql/codes in general
I have a list box with 3 columns and one line on my form and am writing an update query that is to use the value from the first column of the query to update a record in a table. I have referenced the list box as ListBox.Column(0) but the code displays a value of null when I run it and the record that is to be updated is updated to Null (it is blank). How do I write the code so that the value that is in column 0 of this list box is passed through the code?
I'm currently running a replicated database in Access 2003 (plan on migrating to 2010; but have several users on 2003). I guess I pushed the number a fields within a table to be close to the 255 max and of course had a conflict in that table which put me over the top. Now if I receive the following error: "Cannot add a new column to conflict table 'Table_conflict'. Delete obsolete columns and compat the database."Since this will occur with all of my replicas is there a way do either automatically clear the data in the 'Table_conflict' or remove the table?
I just started my internship a couple weeks ago so I am still relatively new, but here's my problem...I have created a query to run the weekly statistics for my data but one column continues to show multiple times. I want the "Left in Estock" and "Left in Estock Line Items" to only show once, instead of all the way down the side. Check out the attachments.
I am using access 2010. I have "classlevel" table with 2 columns-Class and Value1 .Value1 column has numeric values that i ll input from webpage (webpage to ms access connectivity).
I want to sum the values of column "Value1" and i have another table-"Volume" which has 2 columns "VolumeLevel" and "Value2". So i want to match the sum that i calculated from first table-"ClassLevel" with the "value2" column in "Volume" table and get the corresponding "volumelevel" column value from that table and there is a third table that will get this volumelevel value.
There is no common column to join these tables.
Classlevel-
Class Value1 Class 0 3000 Class 1 2000 Class 2 300 Class 3 400 Class 4 500
I would like to get minimal value from "Ski" column. Need to use recordset instead Dmin function because this value will be changed many times. I work with dao.recordset but I never used recordset filter so I need to do something like this:
Code: strSQL = "select tblGoraZleceniaNowaWyceny.id_gora_zlecenia, tblGoraZleceniaNowaWyceny.naklad_pracy, tblGoraZleceniaNowaWyceny.nazwa, tblGoraZleceniaNowaWyceny.Ski, tblMontazSzczegoly.iloscuzytkow from tblGoraZleceniaNowaWyceny inner join tblMontazSzczegoly on tblGoraZleceniaNowaWyceny.id_gora_zlecenia = tblMontazSzczegoly.nazwa where tblGoraZleceniaNowaWyceny.id_wycena_pre=" & Forms!frmWycenyObszarRoboczy!ID_wycena_pre & " order by error desc"
Wor = 5 Get the minimum value from strSQL (Ski column) update this value = Ski+1 wor = wor-1 and loop all procedure until Wor = 0
So the problem is how to requery strSQL to show NEW minimum value at the beginning query - rst.requery doesn't work.