I again ran into something that I can't figure out.
I have a table:
Date
Time
FirstName
LastName
SSN
InAmount
OutAmount
I need a query to sum up the InAmount and OutAmount into one total based on the SSN. This query is placed into a form that is then placed onto another form. The form is to alert the user if the amount of the Inamount and Outamount of a unique SSN totals above $10,000.01 on the current date.
So for example if on 01/01/07 if SSN=111-11-1111 has an Inamount of $5,000.00 and an OutAmount of $5,000.01 thus totaling $10,000.01, then the person's name will appear on the form list. This will change/clear when the date is 01/02/07.
I am trying to create a query that has a self referencing running total based on the values (point totals) of itself (running total of values in the running total column that have already been calculated for all previous records) plus the total of new points being added in the current record, less the total of points being removed in the current record. This running total can never go below 0, if it does, the running total should restart at zero and add in only new points and begin the process again with the next records
I am able to do this in Excel in less than two seconds so I know there has to be a way to port this into a query. I've attached an excel example of what I am exactly trying to do
If it takes multiple queries to complete the required output I am ok with it. In my previous outtakes I have had up to 8 queries but just couldn't seem to do it..
1) I am pretty newbie to this access programming, do forgive me if my questions sounds stupid.
2) Basically I create an application in access capturing or production information for my company. now the top management suddenly wanted whats their main concern:- Total Daily/Monthly, Quarterly, Annual Sales (By Model If possible)
3) I start with daily (Lets don't be too overly ambitious).
4) I try to let user select dates from my calender control and reflect daily sales (in Total & By Model break down) insert into my form.
5) Understand someone told me from my previous post in Calender control I can achieve it either through forms or queries, which is a better way. (in terms of flexibility to change for program maintenance/ scalibility) wise ?
O.K, I am really trying to figure this out from other postings but my limited query experience is limting my understanding of the other posts.
I only know how to use the query wiz and then a bit in design mode.
I have a Query
[ID]pk [Contest Name], [Score]
There will be many records for the same [Contest Name] in the underlying table. Therefore i want to sub total by [Contest Name] so i can then create a report. I have created the report perfectly using the Report support in another posting submitted. But the report does not allow me to order the results as the sum calc is a function on the report. Therefore I am now exploring the Query Sum [Score] order by [Contest Name].
I just need it in a Qery for dummies format.
Go into design mode and put the following in what portion of the query on what line.
I have a query which returns charge_cost (based on course cost, whether it went ahead, if hospitals are eligible for charging etc) which is then used in an existing report.
I want to make another report which simply is:
Total training spend for 2004-2005: £1276.04
And i just want that to be the SUM of charge_cost.
I cant work out how to do this - i did a new query including charge_cost and then created a new field called total_spend: sum([charge_cost]) but i keep getting the message "You tried to execute a query which does not include the specified expression charge_cost as part of an aggregate function"
hmmm... found another little problem. I've got a list of ingredients with cost and amount from a table, total cost per ingredient is simply amount times cost, how would I go about getting a recipe total by summing the seperate ingredient totals?
is there a way to calculate/store total cost value of qty x unitcost in total cost field of same table. if it requires a query, would appreciate guding me how to write it.;) ;)
Hi, I am trying to write a query that will total the number of fields that have matching values. For example i need to have IP addresses added into the table via a form, that bit is done but i need to create a query that will count how many times an individual IP address is added to the list. So that on the report i can show the list of IP address and instead of showing duplicates it will show how many times it has been added to the table.
Any help on how i could do this would be greatly appreciated.
Does anyon ehave any experience of running totals in an access query. I'm reporting the data through excel not access reports so need a query not a report solution..
What I would like is to have an additional column which keeps a monthly summary of spend based on running total month 1to 12. All items have months 1 - 12 and are ordered in that fashion.
I have a database, in which I need to add up the total number of entries made at any point of the day. I have started by creating a query with the entry's SerialID (unique) and the date it was entered, however I am stuck already.
I quess it should be simple. But I couldn't find an answer or example in Access books and online. I have an access 2000 database with a Accounts Receivable table. I am building a query that returns accounts what are 60 days past due and calculating total ballance of ONLY past 60 days accounts. I managed to write a code to display 60 days past due acounts, but when I use UNION query, it calculates total from entire Accounts Receivable table, but I need only total ballance of past due accounts.
Here is my SQL code
SELECT [Accounts Receivable].InvoiceID, [Accounts Receivable].[Patient Last Name], [Accounts Receivable].[Patient#], [Accounts Receivable].InvoiceDate, [Accounts Receivable].PaymentAmount FROM [Accounts Receivable] WHERE ((([Accounts Receivable].InvoiceDate)<Date()-60)) UNION SELECT 'TOTAL', "","","",Sum([Accounts Receivable].PaymentAmount) FROM [Accounts Receivable];
I need my query to look like this.
InvoiceID Patient Last Name Invoice Date Payment Amount
23 Smith 05/01/2007 $100 25 Doe 04/03/2007 $200 Total - - $300
Am trying to create a query for a chart where I can total the employees over time but am having real trouble creating a running total from the "Total" field within a query but cannot seem to get it at all.
SELECT Sum([CountOfStartDate]-[CountOfLeftDate]) AS Total, Atest1.StartDate, Atest1.LeftDate, Sum([CountOfStartDate]-[CountOfLeftDate]) AS RunningTotal FROM Atest1 GROUP BY Atest1.StartDate, Atest1.LeftDate;
I have a series of dates with events that occured on those dates. Some events were extended, others were not how do I get a running total, cumulative total, for all records in the RunTotal column?
I have a database of song track data with track length as a field. I want to produce play lists up to specific lengths e.g 15 minutes and just want the query to show me enough songs to fill up this time period. Any help appreciated - especially simple solutions! Jim
Quote: "Find the total price (SUM) of all stock items in the database (use total query and find the SUM of the [price of stock]*[quantity on hand]"
Ive tried several times to do this, each time unsucessfully because im unsure how to go about it. i can get the sum of those two things, but i cant multiply the two.
I have a query that is filtering records from a table, I have used the Totals row in the query to Group By and provide Count of totals. The datasheet view of the query has the total row and is working fine. I would like to display the total row on a report, using the query as the record source.
It does not seem to be available, so I put a text box in the footer of the report with the Control Source set to: =Sum([CountOfPermit_Type]), but that only returns an error.
Ive got an SQL query as below, what Im trying to do is get the total value of that SQL query and drop it into a form text box.
The placing of the result on the form textbox isn't a problem but getting a sum total of the query result is proving to be a little tricky tricky tricky.
Code: Dim strSQL As String strSQL = "SELECT TestTable.Hours FROM TestTable" & _ " WHERE (((TestTable.sUser)=Forms!Submittedsheet_frm!AdminSelect_Combo.Column(0) AND" & _ "((TestTable.[Task Date])>=[Forms]![Submittedsheet_frm]![FromDateAdmin_TXTBox] And" & _ "(TestTable.[Task Date])<=[Forms]![Submittedsheet_frm]![ToDateAdmin_TXTBox];"
Is it possible to total columns in a query? Right now, I have a query that produces the following column counts, but I'd like to total Pending, Overdue, etc. This data is being displayed in a subform.
Process Pending Overdue Total ------------------------------------- Engineering 1 2 3 Procurement 0 6 6 <etc> ------------------------------------- TOTAL 1 8 9 <- this is the line I want to add
Here's what the query (qryStatusRptB) looks like thus far: Field: Process Table: tblProcesses Total: Group By
Can someone explain how to get the TOTAL ROW in here? (I can do it via another query, but that won't work since the data is displayed in a subform. I've tried crosstabs without success.)
Hi, All: I have been struggling for this question for a long time.
I have a total query coming from two tables. This query has following field: productline device component
The table has more field. One of them is status for component field.
My application is that there are many productline. Under each productline, there are many devices. Under each device, there are many components. Each component has one of 4 statuses. The status is text value, 'Yes', 'No', 'UR', and blank.
In the form, I need to use continuous form to display each device with totalcomponent (I use Count of component), percentage of status1 based on totalcomponent, percentage of status2, etc.
My question is: I tried to use Count(IIF([status] = 'Yes', 1, 0)) to get percentage. But [status] = 'Yes' seems not right because I got a count of all statuses, the same result of CountOfComponent
Hi everyone, Managed to build an Access database with switchboard, forms, reports & queries but I'm left with two annoying problems:
1) I have two columns in my main table called "SOURCE" and "SOURCE 2". They both take their data from a table called "SOURCE". I run a weekly query so that the jefes (bosses) can see the fruits of their advertising so I get the the advertising source and the number of times it was used by a client, grouped according to number of times used. My first problem is knowing how to produce a TOTAL at the end of the report of ALL the sources as well as the individual count. EG: GOOGLE 24 YAHOO 12 MSN 2 TOTAL 38 In design view I have the following:
FIELD: CONTACTID SOURCE WHENREGISTERED TABLE: CONTACTS CONTACTS CONTACTS TOTAL: COUNT GROUP BY WHERE SHOW: Y Y N CRITERIA: Between [Enter the first date:] And [Enter the last date:]
I haven't used the "SOURCE 2" column due to problem nş2:
2) How do I combine "SOURCE" and "SOURCE 2" columns in my main table in a query? Is it possible? EG on my form a client may have contacted us via GOOGLE the 1st time and then by YAHOO the 2nd time. I want to reflect that in the query, which at the end of the day uses the same table ("SOURCE") to get it's values and then store them in the main "CONTACTS" table. Hope this isn't too complicated and that I'm explaining myself well. Well done to all those experts whose comments to others have already helped me make some great tweaks, especially with mail merging. Thanks. Chris.
hi all, i am trying to create a report based on my query, and would like to split the total time up by 2 diff tasks. admin and investigative. problem i am running into is when using the total time functino i have and setting the criteria to match the task ID i am getting an error saying it is too complex. any ideas? IT goes something like this
AdminTime: NZ(IIf([StartTime]<[EndTime],DateDiff("n",[StartTime],[EndTime]),1440-DateDiff("n",[EndTime],[StartTime]))/60)+(Nz([ExpenseHour]))+(Nz([ExpenseMinute]/60)) WHERE TaskID = 2
I have a table wherein the time worked by 25 employees are recorded. This table has the start time, endtime, break time and late times. The Late Time is the number of minutes that the employee is late to work. I am required to do a query of the team's (all 25 staff) late times per month. I have done a query which shows the late times of the individual on the dates that they were late to work and created a crosstab query for that.
I am going around in circles. How can I have a total of the team's late times in a query? Please, could someone please point me in the right direction?
I have a query that just shows all the records in a table. It is used by the end user for filtering primarily. Now the user would like to see a total for the amount filtered.
For example; the table is for repairs. The query just shows ALL the repairs. The user filters the client field to find all repairs for one client. He then wants to see what the total charges are for that query.
I cant create a new field and sum the records because it is not a totals query. Is there any way to embed the query in a form and use the form portion to sum the filtered results?