Help With Calculated Data
May 9, 2005
I know it is said that you should not store calculated data in tables so I need some input on how to go about a problem I am having.
I am creating a DBase with some aircraft info in it. The DBase will be around for awhile so I plan to implement so sort of archiving later on.
The problem is one piece of info I am tracking is flight hours for the aircraft along with hours on certain components. I have a table with info pertaining to each aircraft by number (1 record per aircraft) one of the fields is total current flying hours. I have another table that has individual flight info including number of hours per flight. I want to add the individual flight hours with the total flight hours to get a new total flight hours. Easy with a query but if I get rid of old flights then how will you add them in the query. The only thing I can think of now is to save the newly summed number in the table which is supposedly taboo. Same with the components if it is on the aircraft during the flight it needs to get the new flight hours on it also .
Sorry if this is trivial but any ideas on how this should be done would be great.
Thanks in advance.
Frank
View Replies
ADVERTISEMENT
Apr 25, 2014
I need to make a calculated field show up on my table. My database is for technicians at work to log their hourly health checks. I have a field on form "Health Check" called "HC_ID" that I automatically bring over to the next form called "Channel_Scan_Form" with the control source property. I would like the data from this field to copy to the accompanying table called "ChannelScan_Table" from this "Channel_Scan_Form". I have tried to place the code in several different events on the property sheet but haven't had any luck bringing the data over to the table. I'm just starting to play with databases, plan on being here for a while and hopefully contributing in the future.
View 6 Replies
View Related
Mar 30, 2007
I am very inexperinced with Access, please be kind.
My problem is that from the form view the simple division of 2 #'s are placed in the correct text box I selected, but I am unable to get the value to enter into the data table. Please help.
Thank you
View 4 Replies
View Related
Mar 19, 2014
My employer is using Windows XP Pro and Office 2003 (a few machines have Office 2010, but not mine). Furthermore, the machines are running the Japanese language OS, which has caused some comparability issues with my English XP/Office 2003 at home.
I have a form containing an unbound textbox, with the name MIS. The form's Current event has the following code:
If IsNull([[ResignationDate]) Then
MIS = DateDiff("m", [NichiiGakkanStart], Date) + Int(Format(Date, "mmdd") < Format([NichiiGakkanStart], "mmdd"))
ElseIf [ResignationDate] > Date Then
MIS = DateDiff("m", [NichiiGakkanStart], Date) + Int(Format(Date, "mmdd") < Format([NichiiGakkanStart], "mmdd"))
[Code] .....
The calculates (correctly) the Months in Service of the employee who's information is being viewed.
Now, I am trying to create a report which lists the employees by work locations. The above , and other calculated information, is to be displayed in the report.
I used the wizard to create the report, using data from two different tables (employee & location).
I need to display the calculated information above for every employee at every location.
Example:
"Work Location"
"Employee Number" "Given Name" "Family Name" "Months in Service"
The report, as it is now, displays all work locations and the above employee info except the calculated data.
I've read up on using calculated fields in tables, and I'd prefer not to take this approach.
View 5 Replies
View Related
Aug 11, 2005
Hi all ... been awhile since I have had to create a database so I have gotten a little rusty. :eek:
I have a form where some of the fields I have formulated to calculate an amount. Example... =[GrossAmt]*[FeePercent] This is calculating into the form correctly but not writing to my table for that field. What am I doing wrong or missing here?
View 5 Replies
View Related
Mar 29, 2006
I have a textbox on a form that displays a calculated number with regards to input from other text boxes.
I need this calculated number to update to a corresponding field within a table.
I have a button that updates the information, but the calculated field will not update.
I have an "=" expression written that does all of the calculating. When I put this in the 'control source' it calculates and displays on the form perfectly, but will not update the table. If I change the control source to the field within the table and then move the "=" statement/expression someplace else....the field is blank on the form, but I can manually input a number and it will update to the table.
Follow?
View 1 Replies
View Related
May 22, 2006
Hi Guys, I don't know Access very well but I know enough to generate a 2 dimensional database. The problem I have is that I have been asked to look at a travel agents database to create some additional letters. The problem is that they use a form which has an underlying data table called customers. When they create a record in the form all fields in the customers table are filled in except those on the form which derive their data by calculating two or more fields i.e Date Due is [Date of Travel]-70 (days), Balance Owing is [Cost]-[Deposit]. None of these derived fields fill in their corresponding fields in the customers data sheet.
I would welcome any ideas please. Thanks in anticipation
PompeyFC
View 3 Replies
View Related
Sep 14, 2006
i have a total in an invoice with is a tabulated form with totals in the detail footer I want to post the calculated total (control) to a table. How ia this done.
View 2 Replies
View Related
Nov 27, 2006
I understand that any data that is inputted into a form is always transferred back to the table in question.
In the form I created, I had
4 subheading scores added together to form another subheading named function =([1]+[2]+[3]+[4])/4 was the formula that I put into the control source. The calculation worked fine on the form giving me the correct name. However, this number did not transfer back to the table simple being labelled as zero. Can someone please advice!
View 14 Replies
View Related
Sep 14, 2004
Somebody please help me!!!
I am creating a database that will record the details of approx 30 shops and will store information on Annual Turnover, Profit, Return, etc.
I need to create a field that will calculate the increase/decrease in annual turnover between the current year and the previous year.
So far I have created a subform that will show the last 12 years of data for the particular shop, but now I need to add a calculated field that will get the current years turnover and also reference the turnover for the previous year, i.e. the previous record., and display the result. The other thing that I will need to do, is to have this field not calculated for the initial years trading, so this field will need to be hidden in the first record.
Can someone please offer some advice on how to go about achieving this???
View 1 Replies
View Related
Mar 12, 2014
I have calculated files in a form which is summimg the working hrs of each employ�es for a particular data.
I am able to show the same in the form but want to add this value in the table.
Is is possible to add this data from the form to the able?
View 1 Replies
View Related
Aug 23, 2012
I got Gross Income Query. But I have employees that have overtime rate as well
So I have to calculate using overtime Payment And Gross Income Separately
So I make query and in query . I write this equation
Ovetime Pay: IIf([Total Hours Worked]>[Normal Hours/week],([Total Hours Worked]-[Normal Hours/week])*[Overtime Payrate],"0")
I successfully calculate it ...
BUT IT JUST GIVE ME THE VALUE LIKE A NUMBER SUCH AS e.g. 50 ,150 but instead of that i want currency data type of that calculate field for e.g. 50 become "$ 50".
Okay so in able to do that i go to properties Sheet of the field of the query and change Format to Currency ..BUT IT DOESN'T CHANGE !!!
DATABASE PAYROLL - Copy.zip
View 2 Replies
View Related
Oct 20, 2014
What I'm trying to do: I have created an unbound field within a subform's footer to calculate the average of the displayed record values. The subform is in datasheet view. The records are returned based on a query with a relationship between two tables. I need the calculated data (which I currently have displayed on the main form) to populate within the master table.
I can't figure out how to automatically do this. I created a simple command to get it there, but I'd like the user not to need a button to display a calculation.
Main form based on TableA; subform based on TableB.
Here's how I have it set up (Btw, I suck at SQL I just figure this is easiest to read):
Query SQL looks like this: SELECT tblB.Field1, tblB.Field2 FROM tblB.Field1 INNER JOIN tblA ON tblB.Field1 = tblA.Field1
Main form: unbound txtbox = [Forms]![frmA]![subfrmA].Form.[txtAvg]
The field that is averaged is tblB.Field2. There are potentially a bunch of records displayed in the subform.
I need that [txtAvg] field to save to TableA. My command button is simply Me.tblA.FieldName = Me.unboundtxtbox. I'd like to do away with that.
I tried to use the on current or on load event for the main form; but the calculated field value is 0 until it calculates it. It seems like there is a short delay before the value shows up on the form at which point the on current or on load events don't pick up the calculated value; just the 0 that is initially there.
View 5 Replies
View Related
Oct 12, 2006
I've read over and over that calculated data is bad, that's fine with me... but here is my dillema...
I have four fields that interact with my calculation in a single form. There is only one table in the database.
AmountF (The stored data in the table) (amount financed)
FC (calculated by =[amountf]*.25) (finance charge)
Amount Paid (used in calculation of total due)
total due (calculated by =[amountf]+[fc]-[amount paid])
The math already works, everything works. I can choose to print the form and it looks great. However, I would like for it to (when I'm done printing the form) somehow save the total due data to the AmountF column in the table. AmountF is in the same line as all the other information, so I would like it to not create a new record just update the old one.
All four of these fields have a text box in the form for themselves.
View 4 Replies
View Related
Apr 25, 2005
I have a table with numerous fields including timeIn and timeOut field (these are date/time format). I need to find out how many people were clocked in during each operating hour (based upon their time in and time out). How can I run a query that will allow me to use the times in and out to 'flag' each hour that each person was on duty (a new field for each hour) so that I can run a count on the completed data for every hour?
View 4 Replies
View Related
Jul 18, 2013
I am trying to change the data type of a field in a table from calculated to something else. It gives me the error "this data type cannot be changed once the field has been saved"
Is there any work around to this?
View 2 Replies
View Related
Oct 20, 2014
I would like to append a text item to each value in a calculated field. consider the field name is "Division" and I want to append the word "Division" to the values put out by the field "Division"
My attempt was: Division & " " & "Division". This produced an error in the report.
View 4 Replies
View Related
Jun 3, 2014
I am trying to construct a crosstab that averages a calculated field from a previous query. It is returning a "Data Type Mismatch" message.
The field I am trying to average is a subtraction of dates to find total days. I assume my field is not a number so I have tried to wrap it in CDbl() to change the type.
The formula is
Code:
CASE_DAYS: CDbl(IIf([Actual Close Date]-[Creation Date]>=0,[Actual Close Date]-[Creation Date],""))
View 5 Replies
View Related
Apr 23, 2013
I am using calculated field as a data type in access 2010.
They are working fine.
However, I added a new field and now the final calc won't work.
I have Subtotal adding loads of fields together. Works fine.
Then I have a VATunit field which is a double integer, so enter 20 and my next field is VATTotal calculates the SubTotal + the VATunit by doing (Subtotal/100)*VATunit. This calculation is fine and gives me the correct amount.
The next field is a Total field. Which adds Subtotal and the VATTotal together. Howver, the Total is the same as Subtotal. It is not adding the VATTotal to it?
View 2 Replies
View Related
Apr 12, 2006
My query contains two calculated fields [TaxSavings1] and [TaxSavings2], which are based on some currency and number-type fields in one of my underlying tables.
I just created another field in my query which looks like: [TaxSavings1]+[TaxSavings2]. Instead of adding the two fields, it actually lumps the two numbers together. For example, if [TaxSavings1] =135 and [TaxSavings2]=30.25, it will give me: 13530.25. I need it just to simply add, i.e. answer of 165.25.
Does anyone know how to correct this? Thanks in advance.
:confused:
View 1 Replies
View Related
Apr 6, 2006
I have a table that contains 2 columns:
1 = Deduction Reference Code
2 = The Value associated with each Code.
for example
Deduction Reference Value
999997 10000
666 6000
Code 999997 duplicates the value within code 666 so I wish to set up a caluclated value to say:
If deduction reference = 999997 then the value of 999997 minus the value of deduction reference 666.
I have tried several statements but none of which seem to work.
Can anyone help?
Thanks
View 1 Replies
View Related
Feb 9, 2006
Hi,
I have a calculated field in a query that concatinates an order number prefix and the part number to give the order number:
OrderNum: [OrderPrefix] & [PartNum]
There are 2 tables:
tblPartsList
PartNum
PartDesc
tblPartsListCategories
OrderPrefix
OrderNumCategory
This works fine except for one of the categories. For the third category there are no entries in the tblPartsList - because they are miscellaneous.
How do I change the calculation so that it works as above where there are corresponding Part numbers in tblPartsList and otherwise gives me the order number and any 2 digits e.g. something like [OrderPrefix]*
Having been trying to do this for ages but having trouble with syntax.
View 10 Replies
View Related
Mar 14, 2006
Hi
I have read a number of these threads now where it says you should not generate new records based on calculated fields. So can some one help with my following problem.
I am creating a customer/contract database where when an order is created, a record set is generated to store dates for invoice periods. I have done this by using the start date of the contract and then adding onto this a value of x days that updates a table giving y records based until the end date of the contract.
Is this the best way to do this or can some one tell me a better way.
Thanks
View 4 Replies
View Related
Apr 20, 2006
hi. i wanted to kno how to have a field in a table that is calculated from other fields if this is possible. for example i have a order table which has a quantity field and a price field and i want to add a total field that will alutomatically calculate the total (quantity*price) and add it to the field. i know how to do this in a query but don know how to get that field from the query into the table. thanks for any help
View 2 Replies
View Related
Sep 13, 2006
Hi,
I have read that it's not recommended to put calculated fields on a table and they should instead be calculated using a query.
How about if I need to store that calculated value in a table (e.g. field1 + field2 = value in field3)
How can I do that please?
Thanks,
B
View 5 Replies
View Related
Jul 9, 2007
I was once told that Access does not like to store calculated values but I would like to.
Here is my expression: =([Shift Lenght]-[Total idle time]-[Total down time])/([Shift Lenght]-[Total idle time])*(0.33*[Total pc])/([Shift Lenght]-[Total idle time]-[Total down time])*([Total pc]-[Total scrap])/([Total pc]+0.1)*100
This gives me the value that I desire, now I need to store it in the table with the rest of the records data.
I am planing on storing 3 -4 expressions like this and then averaging them.
Then building a query to the averages for the day,week,month, and year.
Please be gentle I am not very familiar with access but learning a lot:)
View 7 Replies
View Related