Queries :: Summing A Field In A Sub-database?

Mar 27, 2013

I have a table called Products which has a field called "Product ID" and a few others. I have another table called "Sales", which has a field called "Sales Date".

There will be different dates where the products are sold. Here's my problem: I'm trying to make a query to find out which products make the most sales. However, doing so will also display the products separately by their sales dates. So for example, it'll show...

Product #10 / Jan 1, 2013 / 100 Sales
Product #10 / Jan 14, 2013 / 21 Sales
Product #10 / Feb 11, 2013 / 44 Sales
Product #11 / Jan 5, 2013 / 201 Sales
Product #11 / Mar 13, 2013 / 444 Sales

I'd like the products to be together so product #10 would give 165 sales for example. In the Query, Product ID from both tables are connected.

View Replies


ADVERTISEMENT

Modules & VBA :: Summing Multiple Queries And Summing Time

Oct 4, 2013

I have a sales form. The sales form has many Call, Meetings and Emails linked to each sales record. I want to total all the number of calls, meeting and email records related to the sales record to give a total- Touches.I've created 3 queries;

1 - Counts Calls
2 - Counts Emails
3 - Counts Meetings

These all work fine however when I combine them to attempt to count the results it doesn't produce the correct results.I have a second query as well (no pun intended).

I am trying to sum together a column that has values in Time. The results displays as a decimal. How can I have the result display as a Time i.e. 1:20 (1 hour 20 minutes).

View 1 Replies View Related

Summing Queries.

Jul 14, 2005

i'm going to start this by telling what i am working toward in the end as it is where the problem obviously stems from.

i am trying to create a report which will tell me how many times 'hcapp' is in a table. there are three different fields where 'hcapp' can be placed...i can easily create three different queries which return how many times 'hcapp' is mentioned in one field, but i have yet to figure out how to look through all three fields in one query...is it possible? if not, how can i have a report call all three of these queries and then sum the total?

View 4 Replies View Related

Summing Queries.

Aug 3, 2005

i've a question that hopefully has a simple answer.

i have a query that returns three different numbers (each in its own column)...anyway, how can i make it sum the number of these three numbers...the best case scenario would be if i could have a fourth column appear in the results of the query with the sum...

it would look something like this

num1 num2 num3 sum
1 2 3 6

View 1 Replies View Related

Summing One Field Value To Another

Aug 6, 2012

I have 2 field in a table - CourseMarks and ExamMarks. I am making a query to sum these two values. My code entered through the expression builder is Total: [CourseMarks]+[ExamMarks].

When the query is run there are no results if both fields have a score, but If there is a score in the CourseMarks field and none in the ExamMarks field the CourseMark is returned.All the field value data types are interger.

View 6 Replies View Related

Summing A Calculated Field

Jan 17, 2005

Hi,

I want to sum a calculated field on one of my forms. The field is calculated by multiplying the cost of a good by its quantity. So far I have been unable to sum it. Does anyone know how I can do this?

Here is a link to what the field is related to just so you people know what I am talking about: Project (http://www.access-programmers.co.uk/forums/showthread.php?t=78815&page=1) ...basically I have fixed all the problems mention in that thread. All that remains is this field. I will attach my project in case that helps. (the calculated field is in the Treatment Form) Thanks in advance :)

View 14 Replies View Related

Summing Records Where Field Is Between

Jul 31, 2006

I am trying to create a sum of a field called ec2mo where mopp is between 0 and 2 and then another sum when mopp is between 2 and 4, etc... I've tried a number of different things, but it doesn't seem to work - instead i get a single value for each field (i'm assuming because there are different values for mopp and many other fields)... I've attached the db with just that table.
Thanks very much for your help!
P.S. I'm not really at all good with using SQL so anything that can be done in a regular query would be most helpful!

View 3 Replies View Related

Summing One Field For Default Value Of Another

Nov 23, 2006

I have two Numeric fields in my Table, MCRefill and MCTot.
Actually MCtot is the sum of all MCRefill for a given Cust_ID

I have the following expression in the Default value of MCtot in my form showing both the fields

DSum("[MCRef]","Miracle_Cloth_Main","[Cust_ID]='" & [Cust_ID] & "'")

Somehow it doesn't up in the record when you load the Last record for a Cust_ID

Can someone please help ?

View 2 Replies View Related

Queries :: Summing Records In A Query?

Jul 24, 2013

I have a query which displays sales and cash deposits for the day. I want a sum of all cash deposits.

So it looks like this..

Date________________Amount_______________SumOfAmou nt____________Exp1
17/7/2013___________$55___________________$55__________ __________$55
17/7/2013___________$22___________________$22__________ __________$22

I tried doing it by two methods.. neither of which are working.

In the Amount field, I put it as a Total: Sum. I also tried creating a new field which is an expression which sums up the Amount field. Neither are summing it and just displays the value.

View 1 Replies View Related

Queries :: Summing Query Totals Together

Mar 17, 2014

I have a number of querys which search by month and year, I want to be able to sum up 3 of the querys together and display this in a text box on a form... I have tried dsum etc but I can't seem to do it...

So basically I want the totals which are dsumed into the same form to calculate together in a different query if required... This would be simple except one of the months if from the previous year...

View 2 Replies View Related

Queries :: Summing Data In Query

Jan 28, 2014

Creating a Query that would give me results showing in the attached file column D. I am trying to build volume incentive database to track how much we are going to save once we hit certain volume and rate drops.

View 2 Replies View Related

Queries :: Dataset - Group By Query Without Summing

Jan 15, 2015

I have a a dataset that has recorded encounters with a number of Banded (identified) animals. It is currently setup so that each encounter is its own row; with all the information, including "Band_Num" repeated, but "Encounter_Date" being unique. I wanted to query the table and get it to display the results as "Band_Num" on a row, followed by x columns for with each unique "Encounter_Date" represented. I thought a "Group By" function would work, but that requires a sum, which is not useful.

Complicating this is the fact that not every individual is seen a set number of times, so Animal 1 might be seen 3 different dates, but Animal 2 only on 1 date.

View 4 Replies View Related

Queries :: Expression Summing From Fields With Dates

Aug 3, 2015

I am involved in centrally managing a project , a part of which involves employees of certain companies being given a weekly subsidy for study on academic courses. I have successfully set up a table for all the learners and a related table for companies.

Each learner will receive a fixed weekly rate subsidy in the first year, and a lower fixed weekly rate subsidy in the second year. Somebody (not me) will need to check their paychecks to ensure that employees have been paid and all is above board. The learners/employees can start on the programme at any time. I need a way to track this (total claimed amounts, where they're up to etc).

My theoretical solution, is to have a field for each week a learner is on the programme (52 first year, 52 second), and instead of entering a currency amount in the field, the check-person can enter the date they saw the evidence and are happy with it. I thought then if I create a query that searches any dates that fall within the current claim period (eg >01/01/2015, <=Date()), and multiplies field count that fall within those parameters by first/second year subsidy rate if they're in that table. I think my logic is sound, I am just not sure how to write the query/expression, or if it's possible, or if there is a much simpler way to do it.

View 4 Replies View Related

Queries :: Summing Columns Into Multiple Rows?

May 13, 2013

I have a linked table. The table looks like:

Course 1 Name | Course 1 Grade | Course 2 Name | Course 2 Grade |
Student 1
Student 2
Student 3

I need to write a query that will consolidate all the courses (15 total) into multiple rows like this:

Course name | Course Grade
Student 1
Student 1
Student 2
Student 2

What is the best way to do this?

View 8 Replies View Related

Queries :: Summing Records From Two Queries?

Apr 17, 2014

I have two queries which pull fuel uplift figures by airport from a master table, each query for a separate airline.

Each record is made up of Airport, Fuel Uplift, Month and Airline. I want to create a query that will show each Airport per month with the total fuel from both airlines. To do this I've created a new field titled AirportMonth and then applied a JOIN command. This works to a point but initially only returns records where the same AirportMonth value appears in both tables. I can alter the join properties to show all records from one of the tables but I need all records from both tables. Below is the SQL I have so far.

SELECT JAFyr.Airport, JAFyr.Month, [JAFyr]![Fuel Uplift USG]+[TFLyr]![Fuel Uplift USG] AS Expr2
FROM JAFyr LEFT JOIN TFLyr ON JAFyr.AirportMonth = TFLyr.AirportMonth;

View 3 Replies View Related

Reports :: Summing Calculated Field In A Report?

Jul 17, 2015

I have a report that has four fields: Item, Qty, Price and TotalPrice for each line in the detail section. Total Price is calculated by multiplying Qty x Price. The text box name that holds the Total Price for each line is txt_TotalPrice. I want to have a Grand Total in the report footer. I placed a text box in the footer with the following expression: =sum([txt_TotalPrice]). When I run the report Access prompts me for the parameter value of txt_TotalPrice. I've been trying to solve this for quite a while now - but I'm totally baffled.

View 3 Replies View Related

General :: Geometric Mean - Summing Entire Field

Sep 1, 2013

Here is a link that explains a little bit about it: [URL] .....

However, I'm having a problem with summing an entire field. Access does not have a DProduct() function, so it makes the math of "taking the Nth root of a product of 'X' numbers" kind of impossible without writing a custom function.

View 4 Replies View Related

Queries :: Summing Days Late Through Multiple Columns

Aug 29, 2014

I have 4 revised ship date columns, an est ship date, and an actual ship date. I have a column summing days late for est ship date and one summing revised days late. The expression I am having problems with is to calculate the total days late for the revised. I want it to check the 4th revised and if it has a date calculate from that date. If not I want it to go to the 3rd and calculate from that, and so on. I have pasted the code I was trying to use. It just goes all the way to the bottom of the code and calulates from the 1st revised ship date. I have also attached a jpg of the layout of the columns. I also want to do this in the query using expression builder.

Days Late Revised: IIf( [4th Revised Ship Date] <>null,(DateDiff("d", [4th Revised Ship Date] ,
[Actual Ship Date] )-DateDiff("ww", [4th Revised Ship Date] ,
[Actual Ship Date] ,1)-DateDiff("ww", [4th Revised Ship Date] ,
[Actual Ship Date] ,7)),IIf( [3rd Revised Ship Date]<>null ,(DateDiff("d", [3rd Revised Ship Date] ,

[Code] ......

View 1 Replies View Related

Queries :: Summing Quantities Of Same Product In Multiple Locations?

Sep 30, 2014

I have a transactions table which records a qty number (- or +) and references particular location details (location, room, rack, shelf etc). My question is how do I sum the qty for the same product at different locations. So my user sees that product A has a qty of X in location C and qty Y in location D. I can sum the transactions table qty which does give me a sum based on a single location but each location has multiple racks, shelves etc. I need to know the sum of transactions for the same product for exactly the same location, room rack etc

View 3 Replies View Related

Queries :: Complex Query Sorting And Summing Amounts Breakdown

Jan 28, 2015

I have a shell of my database in the below link for reference. I am trying to create a query for a report that will allow me to track charges and payments per client. Each charge has a ChargeID and each payment has a PaymentID. Multiple payments can be applied to one charge so the same ChargeID can show up multiple times with a different PaymentID. Payments that are catagorized as Third Party Payments will have not only a PaymentID, but a TPPaymentID.

What I need to do in the query and final report is track the total charges (even though the ChargeID may show up multiple times, I only want the charge itself to be calculated once and the charge to only be listed once for each client) and track the total payments as well as sum the total payments for each charge for each client.

View 9 Replies View Related

Queries :: Categorize A Field In Employee Database

Apr 16, 2014

I have a requirement to categorize a field in the employee database.

The requirement is: for any given user designation, if the total number is 10 or more, I need the actual designation itself as the output. However, if a particular designation in the organization is less than 10 in total, the output should be 'Misc - and the grade'.

Also, this will need to be done for each grade as well. For example, though the staff designation 'Software Engineer' count is 15, the designation is present across two grades A and B. So, in the output, for the staff with Grade A will show the actual designation as the count is 11, and for Grade B staff with the desgination 'Software Engineer', since the count is 4, it should display the output as 'Misc - Grade B'.

I would like to achieve this in MS Access 2010.

View 2 Replies View Related

Queries :: Populating New Field In Existing Database

Nov 4, 2013

I am trying to add a new email field to my existing database of 900 employees. I have imported an excel worksheet of email addresses into a new table that has lastname, firstname, employee#, email. The primary key on the new table is email. The primary key on the employee table is employee#, and there is a new field titled email.

The email field in both tables are text fields. In running an append query, it either adds 900 to 27000 additional fields of email only or it says cannot complete because of key code violations. On the join properties I have clicked on #3 all records from source to only equal fields of destination.

View 12 Replies View Related

Queries :: TV Episode Database - Numbering Field

Jun 13, 2014

I have a TV Episode database. In the database I want to number each episode of a show. How do I autonumber a show's episodes when sorted by season then episode and have the autonumber restart at 1 when it hits a new show title?

View 10 Replies View Related

Queries :: Database Of References - Querying Two Values From Same Field

Aug 23, 2013

I'm quite new to Access and have inherited a database from a colleague. It is a database of references from which we have extracted pesticide active ingredient, pest species and crop species using forms. I am trying to create a query that will allow us to search and return unique active ingredient x pest x crop species combinations (but which will return all instances of this combination).

The complication is that the pest and crop species names are within the same field ('taxa'). They are distinguished by a label ('pest' or 'crop') in an associated field ('PestorPredator'), but a query using 'OR' will only return a crop OR pest, whilst a query using 'AND' will return no records (because something can't be a pest AND and crop).

I want to be able to create a table that shows the active ingredient, associated pest species AND the associated crop species each in separate columns. We have tried a couple of methods, including UNION and UNION ALL....

View 2 Replies View Related

Queries :: Filling Blank Field Into All Records Of Database

Nov 22, 2013

I am working with an inherited database. When this database was created, a large amount of data was imported. Over the course of time, I have added additional fields for tracking information. One such field is "Date Started."

Unfortunately, there are almost 500 records without this information and that is skewing some report results.

I would like to do is insert the date of 9/9/1999 into all records that have no data in this field. (This date is well before the creation of the database and would serve to indicate old records, whether or not they are still active.) Copy and pasting isn't working, and I can't do a find and replace, since there's nothing to find.

View 1 Replies View Related

Summing Query.

Aug 18, 2005

hello there...ive a question...i have a summing query which searches for the word "processed" in a specific column of a table...currently if "processed" is not found within the column the query will not return anything...is there a way to have the query return a zero instead?

View 3 Replies View Related







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