I have a field that is giving me the number of business days between a period of time and then I want to subtract that number - the person's PTO time to see the actual days they were available...when I simply type the number in (see below) it works great but I want to set up a prompt that will ask me how many PTO Days to calculate as it will be different for each person I am quering...is this possible?
I have read the Microsoft article at http://support.microsoft.com/kb/q95918/ several times. However, I am looking for an expression I can place in the field name to calcluate the median of another field in the same query. Is this possible? If not, I don't understand how to call the function created in the Microsoft article.
Example (fields in the query) Expr1 Expr2:Median(Expr1)
I have made one form based on query. Its a invoice entry form. I have price, quantity and amount. I want when i enter price and quantity, amount should be calculated. I know its very simple for you. Any suggestion.
Hi All. I have Request, Device and Receive table. All table has DeviceID. I create query to calculate total amount of each type of devices which was requested by link Request and Device tables. And query to calculate total amount of each type of devices which was received by link Receive and Device tables. I would like to create Balance query to calculate: Total_Receive - Total_Request = Balance If devices in Request and Receive table is the same result is correct. But if in Receive table add new type of devices I cannot see amount of new device in Balance query. How to fix that problem? Thanks.
In a query that utilizes a table containing a yes/no field, is it possible to calculate the yes/no field and get a numeric return? If so, can you share how this could be accomplished. Thanks
Hi All I try to create a query based on Table1 and fields Date and Result. Is it posible to get a query that calculate two amount of Result field when that field is null and not null? That two values of Result field I will use to create monthly Pivot report in which each bar will display amonts Completed and NonCompleted result. Thanks.
I have a query that is based on orders table and contains "Qty", 'UnitCost', and "ctualUnitCost", in addition to yes/no control to indicate if "SalesTax" is applicable.
I want an expression in the query to calculate total cost in one of 2 conditions: if no sales tax then TotalCost = Qty*UnitCost if sales tax is applicable then Total cost = Qty*UnitCost*1.1
Is there a way to calculate the mode value in a query?
In a summary query, I need to return the value that shows up the greatest number of times in a certain column of a table. Is there a function built in to Access or an easy way to perform this, or do I have to make my own function to handle this?
I am looking to calculate numbers in query like this if the field name in query is Unit and the second field name is amount and i want that the amount field to calculate the unit field on this criteria..Suppose if total unit is 393 so the calculation should be like this;
First hundred should be calculated with 100.00 X 5.79 = 579.00 Second 200.00 X 8.11 = 1622.00 Third 93.00 X 12.33 = 1146.69
Total should be displayed in the amount field = 3347.69
Hi everybody. I got a access 2000 query that lists :
1)weekno 2)year 3)project (project number ) 4)QweekylyReportHeader (project description ) 5)customer (customer that requested this project) 6)department (department number and name that implements this project) 7)Projectleader ( project leader name and number that is responsible for this project) 8)Task (Task number that is done for this project ) 9)task description (description of task ) 10)employee ( employee number who is working in this project ) 11)name (Employee name and initial and last that works for this project )
12)hours ( number of hours employee worked in this task ) ==> i want cumulative for this 13)salary (amount of salary given to this employee) ===>i want cumulative for this
I want to create another query that lists :
A)cumulative value of hours worked on particular project task up that point. b)cumulative value for wages given for that project task up that point.
The above query ONLY lists hours worked and wages gives for particular project task only during each week.But i want hours worked and wages give for particle project task up to that point in week. For example a project task might have implemented last week but not this so i want to take that in calculation as well. I be happy if some expert show me how i can calculate the cumulative value for hours worked and wages given for particular project task.
Notes:
- There is a possibility that during a particular week no task been implement for particular project. - One employee can work in more then one project - One employee can have more then one salary (amount) for the same project because he might get raise in salary! - Only tasks carried this week will be printed in the weekly report
http://i5.photobucket.com/albums/y180/method007/constraint.jpg ( pic of database) http://i5.photobucket.com/albums/y180/method007/hourlywagesroportfinal.jpg ( query output population) http://i5.photobucket.com/albums/y180/method007/queryindesign.jpg (query in design view)
query that display hourly wages of certain project during each week
SELECT querythisweek.weekno, querythisweek.Year, querythisweek.Project, QweeklyReportHeader.Customer, QweeklyReportHeader.Department, QweeklyReportHeader.description, QweeklyReportHeader.ProjectLeader, querythisweek.Task, dbo_Task.description, querythisweek.Employee, [lastname] & ' ' & [initials] & ' ' & [insertion] AS Name, querythisweek.hours, querythisweek.Salary FROM dbo_Task INNER JOIN ((QweeklyReportHeader INNER JOIN querythisweek ON QweeklyReportHeader.projectno = querythisweek.Project) INNER JOIN dbo_Employee ON querythisweek.Employee = dbo_Employee.employeeno) ON dbo_Task.taskcode = querythisweek.Task;
code for querythis week( calcualte the salary and hours worked)
SELECT dbo_Hours_worked.Project, dbo_Hours_worked.Year, dbo_Hours_worked.weekno, dbo_Hours_worked.Task, dbo_Hours_worked.Employee, dbo_Hours_worked.hours, (select a.amount * dbo_Hours_worked.hours from dbo_Hourly_wages a where dbo_Hours_worked.Employee = a.Employee and dbo_Hours_worked.Project = a.Project and a.Year * 100 + a.weekno = (select max(b.Year *100 + b.weekno) from dbo_Hourly_wages b where b.Year < dbo_Hours_worked.Year or (b.Year = dbo_Hours_worked.Year and b.weekno <= dbo_Hours_worked.weekno))) AS Salary FROM dbo_Hours_worked;
This is for the purchasing guy at my client's office. He has 9 vendors he wants to track their on time delivery performance. The data comes from the purchase order tables in his accounting software, to which I've linked via ODBC.
So far so good. I've created a query to pull only those 9 vendors from his total population, then ask for the date range to query by date for the date range (start and end date), and use an expression to calculate the difference between the date wanted and date received so he can tell if the delivery was on time or not. (ex: date wanted: 3/10/06 date received 3/13/06. 3 days difference = late delivery)
The twist is he wants another field so he can mark whether he considers the delivery late or not depending on extenuating circumstances he keeps locked up in his cranium, despite what the date difference results tell him. So, I created a combo box and he can select "Yes" or "No." If he selects YES, a value of 1 is written to the table in that field, if he selects NO, a value of 2 is written to the same field.
So, I need the query to group by vendor, count the total number of entries for that month by that vendor, count the number of "1"s and express that total as a percent of total deliveries.
To summarize, vendor A had 8 deliveries, 5 were on time, meaning he had a 62.5% delivery score. Vendor B had 10 deliveries, 7 on time, meaning a 70% delivery score.
Sorry for the long winded explanation, but perhaps someone can assist. All help appreciated.
I have two excel tables that I linked in access. From excel tables I created query that gives me all data I need.
First table has data of periods and prices of apartment per period. For example:
PropertyID 1111 PropertyName Apartment Zagreb Mila StaringDateOfPeriod 1.1.2015 EndingDateOfPeriod 1.7.2015 PriceForPeriod 100 . . PropertyID 1111 PropertyName Apartment Zagreb Mila StaringDateOfPeriod 1.7.2015 EndingDateOfPeriod 31.12.2015 PriceForPeriod 120
Now as you can see I have apartments with prices that change per periods.
Second excel table gives me information of total paid service that customers need to pay , number of days that he will stay and CheckIn and CheckOut dates of those guest.
In calclutated fields in query I created calculations like TotalyPiad(from 2. table) - OwnerPrice*TotalyNumberofDays . I guest good result IF i have reservations that matches or is it BETWEEN StartDate and EndDate of periods.
BUT If I have reservation that is overlapping , where CheckOut of guest is 1 or more days > that EndDate of selected period I have problem with calculation because my calculation is based on WRONG price in that period.
For now what I manage to do is to create separate field in query where I calculated number of days that are out of range
CHECK_IN - StartingDate of period CHECK_OUT -EndingDate of period Check-in date - starting date of reservation of guest Check-out date - ending date of guests reservation nabavna cijena - owner price
But still when I calculate those number of days I multiple those number of days with old period.
So How can I MULTIPLE THOSE NUMBER OF DAYS WITH PERIOD +1 , I meen next period not this old one just for those days that are out of range? [CHECK_OUT] +1 doesn't work it just add extra day in my CHECK_OUT filed
My final idea is : Separately calculate in one field number of days that are out site of range Calculate number of days of reservation of guest that are in range = make sum of those two fields
From that I will create report which I will send to our owners of properties (number of reservations, reservations details, price that they need to pay to us ...)
I also thought this could be possible to make using VBA but I am still not skilled anough in it. Also I was thinking of creating calendar where I would that add those two queries but how to create simple calendar in Access. Is there some template for simple calendar in Access?
I have created a database that records the scores of each player etc and puts them in league table like structure.
Within this database which I would like to extend I would like to know if its possible to have a query to calculate a league table for the teams if home team overal score is greater than away team home team get 2 points for win 1 for draw no points of loss and same if away team won.I also want to be able to change it to a web database and add club address details like contact list to it.
I am trying to write a function in an access 2007 query that will calculate the date range for each of my records based on the month-ending date and the In-transit days assigned to each record (excluding any weekend days) (i.e. if the in-transit days number is 5 & the month ending date is 5/26/12 then my date range would be 5/22/12-5/25/12). I want the funtion to calculate the range, I cannot use parameters as each record will have a different range based on it's in-transit days .
I have a AS400 database table that stores time in the following manner 70535 (hour, minutes, seconds). Utilizing access 2010, I have used the left, mid, and right command to separate hour, minute, and second into their are separate table values 7 05 35. The AS400 database stores 3:15:30pm in the following manner 151530.
At this point, I used the string function and created the following table value 7:05:35.
Overall, I am needing to convert 70535 to time and then calculate lapse time where the employee name is the same. my database has about 2500 unique employee records per day. I am utilizing a query to perform the above.
date name tstime hour minutes second time 2/8/14 NJohn 151530 15 15 30 15:15:30
When I calculate the values of the fields it pastes the values after each other.For example: if you have the values 1 and 2 (which should become 3) then the result is a value of 12.I've tried changing the function to SUM() but that didn't work.The reason I am using NZ() is due to the fact that some values have a NULL value in one or both of the fields and if NZ is not included it will not calculate anything.
To calculate the percentage of the number of passengers in the total number of passengers per single order using query:
Code: SELECT
Code: A.Date, A.Plate, A.Pax, A.Agency, A.Code, IIf ([pax]> 0, Round ([Pax] / (SELECT Sum (Pax) FROM Sheet2 as B WHERE B.Date = A.Date and B.code = A.code), 2), 1) AS KOR FROM Sheet2 AS A ORDER BY A.Date;
Query works fine in all cases except one, and that is when the encounter a same order in one day
01/04/2013. D_1 0pax 01/04/2013. D_1 5pax
in this case the formula gives a coefficient of 1 to 0 passengers and coefficient of 1 to 5 passengers, should be given a score of 0 0 of passengers and 1 to 5 passengers
2 tables, tblStudentMarks and tblGrades 2 Queries qryResults and qryStudents_Grades
1.qryResults:Calculates the TotalAverageMaths+English+Science)/3. 2.qryStudents_Grades:Calculates the students grades based on the TotalAverage by comparing the total average to the min & max marks on the tblGrades.
Grades are compared within a range specified in tblGrades with the following SQL wich is the query qryStudents_Grades:
Code: SELECT SM.Student_ID, SM.Students, SM.TotalAverage, SM.Maths, SM.English, SM.Science, GD.Grade FROM qryResults AS SM INNER JOIN tblGrades AS GD ON (SM.TotalAverage>=GD.MinMarks) AND (SM.TotalAverage<=GD.MaxMarks);
Question: i would like to also calculate the grades of the individual subjects in the same query (qryStudents_Grades), where the marks got by a student in the subject..say maths is compared to the (tblGrades) and grade is displayed in a colum say maths_grades for each student.
How can i do this for all subjects in one query. (qryStudents_Grades)?
I am trying to create an attendance database, our company introducing the point system attendance,
Called Off (CO) 2 points Left Early (LE) 1 Point Tardy (Tar) 1 point
Employee can reduce point if they have perfect attendance for 90 days from the last day of violation. For example, an employee absent on 01/01/2015, he will received 2 points, the credit will giving on 04/01/2015, if there is no violation, but if he absent again on 03/31/2015 not only he will received 2 more points his 90 days will start from 03/31/2015, now he will eligible to get credit on 06/29/2015 and so on.So far I have created 3 tables and 1 query.
Tables
Employees: Id, Last Name, First Name Points: Id, Description Points Attendance:Id, Date, Employee ID, Points ID
Query Date Employee ID Last Name First Name Point Description Points
how and which formula to use which calculate the points based on above example.
tell me if it is possible to calculate a value in a column in a datasheet view of a query. i.e. I want to take a value in 'Column A' and subtract the value in 'Column B' to create a value in 'Column C'?
I am struggling with calculate difference between two query table values, I first created a make a table query(current meter reading) which contains one column called "meter read" , and I created a second make a table query(previous meter reading) which also contains "meter read" column, I linked those two make table queries to calculate the value difference between two date, how can I create a form to calculate diff between any two date?
I'm trying to build a query with an iif statement to calculate expiration dates within a query. For some reason what i'm trying to do is not working as expected.
Here's the situation. Every employees with an exception of two employees in the company has an expiration 2 years after the class took place. The two exceptions are the certified instructors who's training certification is good for three years.
I've created a query with the employeeid, training subject, and maxoftraining date.
I'm trying to write an if statement to give me the expiration date based on the above information. Here's what I have so far; however its not calculating based on the criteria.
Expiration: IIf([tblemployee]![EmpID]=1 Or 2,DateAdd("yyyy",3,[maxoftrainingdate]),DateAdd("yyyy",2,[maxoftrainingdate]))
At this point in time, all "expiration" dates are showing + 3 years rather than just the Employee ID's 1 and 2 and the rest +2 years.