Calculating The Most Occuring Record In A Table.
Mar 10, 2008
I have a Database that contains a number Albums and Artists. I also have a table that contains orders from customers for these albms. Basically i want to track which album and artist is bought most? Can any one help?
View Replies
ADVERTISEMENT
Sep 20, 2013
Code:
DateAdd(Interval, Number, Date)
function. More specifically, I am using a bound form with a table that I need the date for. The date will be an integer from a specific record (based on a search) from a separate table, and then added to the current day's date (in days).
View 3 Replies
View Related
Feb 8, 2005
I have a fixed length .txt which I am linking into a MS Access 2002 d/b.
My options are set to :
default open mode -shared
default record locking - no locks
Open database using record level locking is unchecked
the (datasheet) form is set to:
allow edits/deletions/additions - no
recordset type - snapshot
record locks - no locks
the text box objects are set to:
enabled - no
locked - no
I have no requery actions associated with any events at all.
My problem is that while the form is active I am unable to open the source .txt and if it is already open I cannot save it. There is obviosuly a lock occuring on the .txt object - how can I prevent it occuring?
thanks!
Gordon
View 2 Replies
View Related
Sep 27, 2006
I have posted this once before, but didn't get a response that really helped me out. I have a series of complex calculations on several queries that ultimately point me to two calculated cells. When it comes down to the end, it's essentially this simple. A + B = C; A - C = D; so C + D = A. BUT when I'm making this calculation in the query, the last column, which should be A - C = D, Access zero's out C and the full amount is showing up in D. So essentially, A = D. Which this should never be the case. We've been working off an excel spreadsheet but transferring to Access, so I know the logic is there, but can't get the very last thing to work. 98% of the time, D is going to be $0. But the 2% is really throwing me off. Here is my SQL of the query. The section separated at the bottom is my troubled spot. If needed I can zip up the file if it helps. I have been battling this situation for a month now and written it several different ways. Any help would be greatly GREATLY appreciated.
Thanks,
Jason
PARAMETERS [Aging Date] DateTime, [Performance Date] DateTime;
SELECT [Trend - Detail Query MI Category].[Reporting Entity], [Trend - Detail Query MI Category].[Due Date], [Trend - Detail Query MI Category].[Ifs Inv From Date], [Trend - Detail Query MI Category].[Ifs Inv To Date], [Trend - Detail Query MI Category].[Ifs Balance Due], DateDiff("d",[Due Date],[Aging Date]) AS Aging, DateDiff("d",[Ifs Inv From Date],[Ifs Inv To Date]+1) AS [Period of Performance Days], IIf([Ifs Inv From Date]>[Aging Date],0,IIf([Ifs Inv To Date]<[Performance Date],[Period of Performance Days],([Performance Date]-[Ifs Inv To Date]))) AS [Accrual Days], [Period of Performance Days]-[Accrual Days] AS [Var Days],
[Ifs Balance Due]*([Accrual Days][Period of Performance Days]) AS [Accrual $], [Ifs Balance Due]-[Accrual $] AS Unearned
FROM [Trend - Detail Query MI Category];
View 9 Replies
View Related
Nov 12, 2007
I need help to calculate time difference from the record above where ID is same. I have attached an example in excel with this request where I have if statement doing exacly what I want to do in Access. I have a table in Access that has three columns - as below
ID, Reg, TimeDiff
66646, 14/06/2007 21:33,
66646, 15/06/2007 06:03, 8:30:00
66646, 15/06/2007 12:20, 6:17:00
66646, 15/06/2007 15:08, 2:43:00
67844, 14/06/2007 04:39,
67844, 14/06/2007 09:05, 4:26:00
67844, 14/06/2007 09:08, 0:03:00
67844, 14/06/2007 16:27, 4:09:00
If ID is equal to the ID in record above then TimeDiff is equal to reg minus reg in the above recored, else blank.
Hope someone can help me with this.
Thanks, GS
View 5 Replies
View Related
Dec 14, 2013
I have a query that records a status update, and the date it was made by an employee etc. The table has a secondary key related to ... lets say a project table.
E.g.
Status Id; EmployeeID;ProjectsID;Status;Date
I want to calculate the average amount of days it takes for a status change occur.
View 1 Replies
View Related
May 18, 2005
I have this statement that doesn't work...
UPDATE table1 SET table1.val1 = [table2].[val2]+[table2].[val3];
How can i add two columns of the same table and update my query?
Thank you in advance!
View 1 Replies
View Related
Aug 30, 2007
Hi, I'm a total newbie at Access, and know nothing about scripts. I've been operating at the level of using the Wizards and drop-down menus. I am trying to create a report that does two things:
1. Displays the results of queries that sum data from a table (I think I have this figured) and
2. Displays those sums as a percentage of a number that is input each time the report is run. (This is only one number that comes from a totally different place and has no prior relation to the data.)
Any help/advice that anyone could offer would be much appreciated!
Thanks!
View 5 Replies
View Related
Jan 27, 2008
Below is an example of my table "Pricedata" include 03 fields:
Stock Name ___Price________Status Date
A________________10________ __1/6/2008_
A________________11___________1/7/2008_
A________________12___________1/8/2008__
B________________22___________1/6/2008_
B________________25___________1/7/2008_
B________________29___________1/8/2008__
C________________2____________1/6/2008_
C________________2____________1/7/2008__
C________________3____________1/8/2008_
D________________56___________1/6/2008_
D________________45___________1/7/2008_
D________________27___________1/8/2008__
I want to create a query like this: can calcualte the price change and % price change in certain period, and then sort in % change.
This result should be like the table below:
StockName Change in three days % Change in 03 days
C 1 50%
B 7 31.8%
A 2 20%
D -29 -51.78%
Thanks all,
View 6 Replies
View Related
Oct 11, 2006
I am having trouble calculating a field in a table and on a form.
I have the following Tables
CUSTOMER: Customer No, Name, Address, City, State, Zip, Discount, Phone, Fax, Contact Person.
ORDER: Customer No, Order No, Order-Date, Delivery-Date.
ORDER LINE: Order No, Product No, Quantity Ordered,
line-item-cost
PRODUCT: Product No, Description, Price, Product Image.
I need to calculate the line-item cost and need it to update every time the user enters a new Quantity ordered on the ORDER LINE form.
I know its (Quantity Ordered*Price)-(Price*Discount) and I did this is a query and it worked but I need it to update in the form and update in the table not the query. I have tried everything (Macros, Queries, and Formulas) and I just can not get it to work.
Does anyone know how to do this?
Thanks
View 1 Replies
View Related
Mar 5, 2005
Hi Experts,
Novice here,
I managed to create a FORM that has fields that calculates basic additions/subtractions formula but for some reason the fields on the TABLE does not update?? Any suggestions?
Thank you,
jola
:confused:
View 8 Replies
View Related
Oct 11, 2006
I am having trouble calculating a field in a table and on a form.
I have the following Tables
CUSTOMER: Customer No, Name, Address, City, State, Zip, Discount, Phone, Fax, Contact Person.
ORDER: Customer No, Order No, Order-Date, Delivery-Date.
ORDER LINE: Order No, Product No, Quantity Ordered,
line-item-cost
PRODUCT: Product No, Description, Price, Product Image.
I need to calculate the line-item cost and need it to update every time the user enters a new Quantity ordered on the ORDER LINE form.
I know its (Quantity Ordered*Price)-(Price*Discount) and I did this is a query and it worked but I need it to update in the form and update in the table not the query. I have tried everything (Macros, Queries, and Formulas) and I just can not get it to work.
Does anyone know how to do this?
Thanks
View 1 Replies
View Related
Jan 12, 2007
Hi, I have never had to do any maths with access before, so I don’t know where to start!
What I need to do is calculate remaining warranty information for products.
In the table I have 3 columns. the 1st column is "Purchase date (dd/mm/yy)" 2nd column is "Total warranty period (years)" and the 3rd column is "Remaining warranty"
The 3rd column is the one that will display how long is left to run! How do I achieve this?
Thanks.
View 6 Replies
View Related
May 8, 2013
I've made a membership database for an imaginary leisure centre as part of my A Level coursework - only after more or less finishing my project, I've realised that I haven't provided a way for the end users to calculate fees for members.
I suppose the calculation I would have to do is multiply the Length of Membership (days) field on the Membership Opportunities by Cost per Month on the MembershipTypes table.
These are the relevant tables and I've also attached my database (the password is "password" for any of the users) ...
View 1 Replies
View Related
Jul 29, 2015
Currently I have a form with these variables
- Assets
- Shifts
- Machine Offline Date
- Machine Offline Time
- Machine Online Date
- Machine Online Time
In the Asset Table I have recorded on each asset the number of shifts it operates for as well as starting / finishing time of those shift. e.g. 2 shift asset will start at 7:00AM finish at 11:00PM
or 3 shifts asset will start at 7:00AM finish at 6:59AM
Now I have 82 assets in the factory and 20% of those machines run 3 shifts. Each shift is 8 hrs.
What I have already done is allocate shifts per asset e.g.
when I pick Asset (a) in the Asset combo box, in the shift box it will automatically generate 2 or 3 dependant on what I have set.
If an asset runs for 2 shifts, it would mean that, that asset is operational/running from 0700 - 2300 or 7:00am - 11:PM
also if an asset runs for 3 shifts it would mean that, that asset is operational/running from 0700 - 0700 or 7:00AM - 7:00AM
These are the scenarios that is entered through a "Form"
Scenario A: Machine (a) breaks down at 1700/5:00PM on the 10/7/15 and was back online at 12:30 on 11/7/15, This machine runs for 3 shifts which would mean in the "Breakdown Downtime" the result should be 19.5 hrs
Scenario B: Machine (b) breaks down at 1900/7:00PM on the 10/7/15 and was back online at 10:00AM on 12/7/15, this machine runs for 2 shifts which would mean in the "Breakdown Downtime" the result would be 23 hrs.
I would like to make this an automatic calculation, Is this possible?
Please note I am not after a "Query", I need this calculation in the main Database table named "Tbl_MaintenanceDATA".
I understand this is not the norm and many have suggested against this, however for the purpose of what I need, it needs to be in the main table with all the other data.
Here are some snip it
snipit2.png
snipit.png
View 5 Replies
View Related
May 2, 2013
I'm trying to make a query where it can calculate the difference between a table field value and a query field value.
Ex. Table INVOICE - fields
invoice no, invoice value,
Query TOTAL - fields
invoice no total invoice value
I need to get the difference between invoice value and total invoice value.
How can I put this into a query (invoice value - total invoice value)?
View 4 Replies
View Related
Jul 8, 2015
I have been trying for about 8 hours to calculate elapsed time between two fields into a third field in Access 2007. Unfortunately, the expression
IIf(IsNull)([Final Suspense]),DateDiff("d",[Routing Status Date],Date()),DateDiff("d",[Routing Status Date],[Final Suspense]))
is not working. Image enclosed....
View 6 Replies
View Related
Oct 11, 2006
When I use the code given to me the program complies but it does not show the new total price in the for box
dim a, b, c
a = me.[your quantity textbox]
b = me.[your price textbox]
c = a*b
me.[your total textbox] = c
This is the code I used and my total box is called (line_item_cost)
is there anything that I am doing wrong?
View 5 Replies
View Related
Mar 4, 2015
I have a table with staff in.
I have a table with the start and end of their shifts.
We have four possible locations and four weeks.
So I have four tables for each location.
I have a module that can work out hours and deductions based on time in and out. I built that into a seperate databse working on a one time in and one time out setup.
I want to incorporate the two so I can get the hours worked over four weeks at all locations and divide that by 4 to get the average weekly hours for a staff member.
View 8 Replies
View Related
Sep 18, 2014
I'm trying to create something like an online banking view that shows the running balance as each transaction occurs. I have tblTransactions with fields AccountNumber, ItemDescription, and TransactionAmount. I'm trying to create something that shows these three fields and a fourth field with the running balance.
So if I initially deposit $100 it will show the first record with TransactionAmount = $100 and RunningBalance = $100. Then the next transaction will subtract the Transactionamount for the new record from the RunningBalance from the previous record to get the RunningBalance for the new record. So if I make a purchase for $2, the AvailableBalance for that record is $98. Is this possible with a query? Here's a picture to describe what I'm talking about ....
View 3 Replies
View Related
Dec 23, 2013
I have got problem with ms access report. I want to make a report which is based on
1) first master table
2) first slave table
3) second slave table
I have done some research and decided to do some form with subform. So I have got the view one record from master table and many record from slave tables in one view.
But it turned out that it has become duplicate records. (the relationship are ok - it duplicate master record as many as slave records)
So:
1) how i can do ms access report from multiple tables - one master record with multiple records form slaves tables
View 5 Replies
View Related
Aug 1, 2006
Hi! Please help!!!
I'm currently building a bookings database and have encountered an alert message that I cant seem to rectify -
"You cannot add or change a record because a related record is required in the table 'Booking Details'"
Basically - I have a 'Customer Database' form that is linked (via command button) to a 'Booking Details' form. Within 'Booking Details' I have 2 sub forms - 'Booking Quote' and 'Booking Payments'. Both subforms are linked to the 'Booking Details' form by the 'booking ref' field with RI.
I have no problem updating information in the 'Booking Quote' subform, but when I try to add information to 'Booking Payments' it states the above message.
Can anyone please advise as to how I can prevent this happening? I'm slowly losing my mind....!!!
Many thanks,
Stacey
View 10 Replies
View Related
Oct 22, 2012
Currently I keep getting this error: "You cannot add or change a record because a related record is required in table"..My current tables are this:
Primary Table with persons info:
Primary Key - Auto number generated
Name
Address
Email
Phone
I have 4 other tables with use check boxes.
ex:
Table 1 - Geographic locations visited
ID - Auto generated
USA
CANADA
ASIA
ECT...
Table 2 - Languages Spoken
ID - Auto generated
Spanish
Chinese
English
Table 3 - Skills
ID - Auto generated
Hunting
Dance
Singing
Weaving
Is this not a genuine one-to-one relationship table? I mean No two people would have had visited the same places and speak the same language no? I tried to create a one to one relationship with the primary key to the auto generated ID of the child tables but I'm sure that is not how you do it. Also when I try to save the check boxes in my form and I close it and come back it doesnt save and is blank again. Is it because my form gets its information from a query that takes all the information from all the tables.
how I can get this to work properly? Am i to make use of a foreign key? I've read a lot about it online and watched youtube videos but I dont see why I need it here in this case. Is there a way to set the IDs in the child tables to be the ones from the primary table? Or do I have to use a foreign key and manually input the primary ID into them?
Or would it be better to have all these child tables in the primary table and have one large table instead? I just didnt do that because one of them has like 20 checkboxes with cities and locations
View 12 Replies
View Related
Aug 22, 2013
I have a form that using "Query A" as data source. The Form need add (edit) a field value before save that Query Result to another Tabel. Is it possible to do that?
The PROCESS simply like below: Tabel A --> Query A --> Form -->Edit value a field -->Save to Tabel B
if it is possible, are there some requirements that have to be fullfilled?
View 2 Replies
View Related
Nov 16, 2014
I have the following script which updates fields in a table.What I am after is a msgbox script to list the ID field value once it is updated.
Code:
Set rec = dbs.OpenRecordset("Select * from Stk_Merge_Delete_Register")
rec.AddNew
rec("StkItemID") = [Forms]![MergeItem]![txtStkFrom]
rec("RackID") = [Forms]![MergeItem]![txtRackFrom]
[code]....
View 3 Replies
View Related
Feb 22, 2015
I have created three tables, all of them are connected by one-to-one relationship by same field, as you can see in the screenshot. and at the same time I have created three forms for each table. then I brought two forms in one remaining form. so whenever I entered data in first form and click on the next tab in which another form exist, it gives me this error: "you cannot add or change a record because a related record is in table".
View 2 Replies
View Related