Of Saving Queries And Calculating Fields

Sep 6, 2005

Morning All,
Just wondering.

When a form needs a calculated field. Say something simple, like

TotalCost = Quan*Cost

Is it better to create a query?
Use a table and create the calculated field in the query builder?
Or use a table and create a new unbound field on the form with the formula in it?

I never really know which one to do.

Lately I’ve been using saved queries for almost everything and now I have several dozen in this data base and its only half way done. Soon I’ll have to create a data base just to keep track of the queries in this one.

View Replies


ADVERTISEMENT

Queries :: Calculating With Null Fields In A Query

Oct 2, 2014

My training database requires me to identify each training record in the tblEmpTrainHist table as either "Compliant" or "Delinquent". I thought a simple calculation in my query:

RecordStatus: IIF([DateReceived]<=[DateDue],"Compliant","Delinquent")

would do the trick. However, I did not consider the records where the employee has not yet completed the training and the field [DateReceived] is Null. There are two considerations: those employees who have no [DateReceived], but have not yet reached the DateDue (Compliant); and those employees who have exceeded the DateDue (Delinquent).

View 5 Replies View Related

Queries :: Calculating Rates Based On Two Fields - Type Conversion Failure

Apr 24, 2013

I have created a make table query and using expressions for two of the fields. I have set the field properties (format) to "Percent". The expressions are calculating rates based on two other fields. The expressions are currently as such:

PTD_CM_PGM_RATE: IIf((IsError([PTD_CM_REPT_PGM]/[PTD_CM_REPT_ER])),"0%",[PTD_CM_REPT_PGM]/[PTD_CM_REPT_ER])

I'm using the IIF function to avoid potential errors should one or both of the values ("PTD_CM_REPT_PGM" or "PTD_CM_REPT_ER") be zero.

However, when running the query, I am getting the "...type conversion failure is caused when the data in one or more fields doesn't match...." error.

View 1 Replies View Related

How To Group Fields And Corresponding Fields, While Calculating Sums?

Aug 4, 2005

I have two tables - Hours and Employees. Employees table has these fields:
EmpID, and First, and Last name.
Hours table has these fields:
EmpID, Hours, Funding Source, Nature of Work, Pay Period

I need to produce a report or a query that will display these results:
A column with a list of all the employees and all the Nature of Work categories going across with the sum of hours for each Nature of Work. I'm attaching an Excel spreadsheet that shows kind of what I need. Also, these reports need to be produced for each Funding Source and
Pay Period, so something like [Enter Funding Source] and [Enter Pay Period]

My question is that I don't know how to make a report that will just list a column with all the names and count the sum of hours for each Nature of Work.

Hope this is not too confusing, and any help would be greatly appreciated. thank you!

View 8 Replies View Related

Need Help Calculating Using Fields In MainForm And Fields From Subform

Sep 25, 2006

Ohh Stress. Need Help....I have a mainform that contained two subforms in it. MainForm called "Employee", the two subform called "vac", and "Prevac". There is a field in my mainform called "Hours", that I'd like to use to Add with a field in Vac subform called "VacA" and a field in Prevac called "FHours". I'd like to display the total (sum of all three field on the same mainform. Is there anyone have any idea? Thanks in advance...

View 3 Replies View Related

Calculating Fields

Nov 10, 2005

i have two text boxes in a form:
1) Todays Hours
2) Total Hours

when i enter a number in text box todays hours i want the value in the text box total hours to increment by that amount. this operation will be done on a daly basis for a internet cafe where the user comes and i put in the hours. it seems simple but i really do not know. could someone help me please :confused:

View 1 Replies View Related

Calculating Across Fields

Dec 20, 2007

Hi,

I am creating a form which has many fields which should have values in them. I need to know how to total all the fields across each field.

I have managed to do this(almost!) by creating a text box, and "on lost focus", putting the VBA:

TextBox = [SumOfConnection Bonus] + [sumofspice bonus] + [sumofvolume bonus]

(When I get this working I'll make a field in the table so there is no need for the text-box.)

This is basically, three types of commision that I want to total at the end in a "total". The amounts of commision are obviously different for each record but when I click in the "TextBox" it totals the values for the record that box is in ONLY, and all records show the same value in this field. I will click in a different box, and it will change, but ALL of them will change. How do a make it so that all "TextBox" field will show their own value.


Thanks,

View 2 Replies View Related

'Save' Not Saving All Fields

Apr 27, 2006

My form gets its data from a single table. Each field on the form is linked to a field in this table.

Yesterday, running 'Docmd.Save' by clicking on a button saved the displayed data. Today, all of the fields are being saved, bar one.

I've checked that this field is still bound to the same table field and it is.
Could I have I inadvertently set some value that prevents this field being saved?

I'm at my wits end here. Any suggestions?

View 5 Replies View Related

Saving Calculated Fields ( I KNOW BAD)

Nov 30, 2006

I keep getting caught up in the same point over and over again. I need to save a calculated field's calculation to a table field. The problem is how do I do this? I already know about the rules but I need to do this and store that specific information. Can someone post a sample code? The problem is the code and codes I been using dont' seem to work any more. I was putting

fieldname = textbox2.txt
in the form before update box. The problem with that is it would give me an error if the data source the calculation pulls from is not in the table/form.

View 1 Replies View Related

Calculating Difference Between Two Fields?

Feb 22, 2007

I'm trying to create a database for a Cattery business.

One thing I'd like to include is a query that calculates how long a cat has been staying at the cattery and then calculating the amount owed by the owner.

I don't have a cost field in any of my tables, so I need to create this on every run of the query.

So for example

A Cat resides in the cattery from the 22nd of Feb to the 28th of Feb. So 6 days (not including the day the cat is brought into the cattery) at a cost of 4.95 a day equals 29.7

Heres what I have so far
http://www.tdh1987.co.uk/pics/query.JPG

Bear in mind I'm from the UK, so the date field is in a different format to yours.

Any help will be greatly appreciated.

View 3 Replies View Related

Calculating Bound Fields

Oct 3, 2006

I have a table for invoices that need to show Nett, VAT & Total. I have set up a form and have included a calculation on both VAT (Nett*17.5/100) and Total (Nett+VAT) which works well in the form. Because these calculations are in the ControlSource, I do not know how to have these fields bound to the original table.

Am I missing something really obvious???

View 1 Replies View Related

New Member - Calculating Fields Help

Jan 4, 2005

I am new to Access and have made a databse using Access 2000. This is used for a dart league.

In one of the Tables called Members each "record" is made up of the persons details
(Name,address, etc). Included in the Row record I have "fields" (columns) that keep track of
the points each person hits on a nightly basis. I also have a Total Field.

Exampleof fields)

ID#,First Name, Last Name, Address, Phone #, Week 1, week 2, week 3, Total

How do I get the Total Field in the record to add up the nightly points in Week 1 + Week 2 + Week 3.?

In Excel it would be a simple calculation (e.g =sum(a1+b1+c1) etc.

As I said I am new to this database and it is very frustrating at the moment. I have used the help function
but it mostly double dutch to me.

ANY HELP in plain english would be appreciated

View 1 Replies View Related

Saving Calculated Fields To A Table

Sep 14, 2006

I have a small Database that produces invoices, Each invoice could have 5 items on it which are compeleted at different Dates. (cutting hair in an OAP Home) Invoice to be produced at the end of each month which shows what happened each week. This will be generated for each person in the home. I can display all the information in a form when inputing the invoice information. I want a button to copy the invoice number the client name and the total of the invoice to a new table. The total of the invoice is calculated control on the form.

How do I do this??? can anyone help

I need a total in a table to substract payments from.


All Help will be much appreciated.

View 1 Replies View Related

Calculating New Fields In Access Database

Nov 20, 2007

I am working on a system to store financial information. I will be extracting our accounts payable journal entries on a monthly basis into Excel. I want to import that data into an Access table. I have several calculations to perform to create new datafields that I need to store in my Access table. Is it possible to perform these calculations as I load the data? If so what the best method to do this? Here is an example. I will be downloading our monthly hardware depreciation and need to split it among departments based on % stored in another Access Table.

Thank you for any help you can provide me.

Teresa

View 1 Replies View Related

Calculating Total Costs From 2 Different Fields

Dec 21, 2005

I have a table with products and their costs per unit of measure.

some products are costed by weight and others by piece.

table looks something like this:

product
pcs
weight
unit of measure (EA or KGS)
cost

Query should look like this:

product
pcs
weight
Total Cost

Is it possible to write an expression that, depending on the unit of measure uses the pcs or weight field to calculate the total cost ??????

View 5 Replies View Related

Query Help, Calculating Multiple Fields.

Jul 30, 2007

I've imported an Excel file into a table and now I've created a Query from it.
I now need to Add Fields (names are not in the table) and calculate totals for these renamed fields some of the answers are going to be the result of two or three fields.
Any help would be greatly appreciated.
thanks

View 8 Replies View Related

Calculating Between Fields In A Table And The Sorting

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

Calculating Two Fields From A Form And A Subform

May 6, 2005

I have created a form with a subform and I want to subtract the total of the subform from the total of the form to get a balance; i.e. I have a total of expenses on the form and the subform is a record of payments against the expenses and I want to show a balance.

I have been all over this one and can not make the expression work. I have been working in Access for some time but this one has me stumped, I am probably over thinking it or just can't see the forest for the trees.

I have gone into the expression builder and created the formula but when I complete the process I get the #name? error statement in the field.

Can anyone help me with this problem? Thank you in advance. You can send responses to sharon.dunn@newmont.com.

View 2 Replies View Related

Expressions For Calculating Text Fields

May 27, 2014

I am trying to create an expression that determined by text fields. The field is a PASS for FAIL field. The result needs to =PASS if 70% of the total column is PASS.Can this even be done using an expression?

View 4 Replies View Related

Forms :: Calculating Fields And Auto Update

Jun 15, 2013

In this table I have two fields Seats Available and Seats Remaining

When I register a student to a Course in the Courses table I would like the corresponding Seats Remaining field for that course to decrease automatically.

I can, of course, run a report or a query to see how many are enrolled in the course and then manually update the Seats Remaining field (which is what I currently do), but I would like this process to be automated each time I register a new student.

View 4 Replies View Related

Calculating Elapsed Time In The Table Fields

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

Forms :: Checking For Required Fields Before Saving Record

Aug 25, 2014

I have a transaction form and there is at least two fields I need to make sure have been entered before the record is saved.

I have no problem with text or numeric fields but I can't seem to be able to check the contents of a drop down field.

What is the best method to use to make sure a drop down has been selected by the user and contains a value.

I have temporarily used a default value in the drop down but that's not really what I want.

View 3 Replies View Related

Calculating Number Of Work Dates From 2 Date Fields

May 29, 2005

In my Query I have a Date Received field and a Date Approved field.

I would like to calculate the number of work days, which excludes weekends, between Date Received and Data Approved fields.

It would be more desirable to calculate the number of work days, excluding weekends and governmnet obsereved holidays.. but I don't know if that can be done... If not I can stick with the number of work days excluding weekends.

How would I go about doing this? I would need to add a new column to my query?

What would I put for the field and criteria? What kind of expression do I use?


Any help will be appreciated, thanks

View 14 Replies View Related

Saving Queries Issue

May 22, 2006

When I try and save an older query my entire access shuts down without warning. I tried "Save" and "Save As". I even tried saving to a different name. Any Ideas?

View 4 Replies View Related

Calculating Time In Queries

Jan 3, 2007

I have the following feilds in a query: Timein Timeout
I need a subtotal feild that totals the two across midnight
I also need a Lunch feild
Then I need a total feild with the subtotal and total subtracted

I tried using this expression please help anyone if you can

Format([Timein] -1 -[Timeout], "Short Time") this created my subtotal feild

then I had a made lunch feild with 30 mins of time into it

then i tried Format([subtotal] -1 -[lunch], "Short Time") and called this one my total box.

The first one worked the second reported an error. Please any suggestions??

View 3 Replies View Related

Queries :: Calculating Change In A Set Of KPI

Aug 6, 2013

I have the following query, which gathers a set of kpi for an employee across two reporting periods.

Code:
PARAMETERS [Enter_ID] Long, [first_period] Long, [second_period] Long;
SELECT *
FROM kpi
WHERE PERIOD_ID in ([first_period], [second_period])
AND Manger_ID = [Enter_ID];

What I hope to accomplish is to calculate the change from one period to the next. So, say we had Jun 2013 and July 2013 as reporting periods I would want to subtract each KPI in June from the same KPI in July and report on change in that value, for each employee ID. Is this something that can be accomplished with SQL or would I have to use VBA to do this?

For simplicity we will say the only fields in the kpi table are EMP_ID, PERIOD_ID, Manager_ID and the 8 KPI: X1, X2...X8

View 7 Replies View Related







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