Queries :: Implementing YTD Calculations In Access?

Jul 22, 2014

How to implement YTD calculations in Access.

Current table:

Property Month RevenueA Jan '13 100
A Feb '13 50
B Jan '14 200
B Feb '14 300

Desired output:

Property Month Revenue YTD revenue
A Jan '13 100 100
A Feb '13 50 150
B Jan '14 200 200
B Feb '14 300 500

I am new to Access programing and have not been able to figure out a query/macro to execute this.

View Replies


ADVERTISEMENT

Modules & VBA :: Access Implementing Search Button To A Form?

Oct 24, 2013

In my database I've encountered a hitch - I've got one form set up to view one person at a time and I've got many records in this database - Is it possible to create a textbox and a button called search that will take me to the record containing this text?

i.e currently im on record abc i type into the text dfe and press search - it will take me to a record that contains that text?

View 1 Replies View Related

General :: Implementing Substitution Variables In Access 2007

Oct 19, 2012

Is there a way i can use substitution variables in access 2007, i wrote a query that returns rows which have a word okeu in them but i want to use substitution variables so that i can retrieve any word i want and if the word i want is not there i want to pop a message saying `word not there` its easier to do it in oracle sqlplus but how can i apply it in access using sql queries?

This is my sql I made in access

Code:
SELECT MENU.NAME_REC, MENU.C_REC, AUTO.C_GROUP
FROM MENU, AUTO
WHERE (((MENU.NAME_REC)="okeu"));

View 3 Replies View Related

Calculations On Calculations--too Much For Access?

Jun 8, 2005

I have an odd problem that has stumped me for several days. I'm working on a form that contains a chart. The chart is based on a query, which is based on another query, which is based on a table. In the top query, I need to put some calculated fields that operate on other fields. But when I try to multiply two fields together, I get Null. I'm pretty confident that the fields I'm operating on are numerical.

The fields of the query should be:

MaxOfEverInSchool
MaxOfSurvivalToGrade
MaxOfEverInSchool

With these being the calculated fields:

MaxOfSurvivalToGradeCum: MaxOfEverInSchool*MaxOfSurvivalToGrade/100
MaxOfCanReadCum: MaxOfEverInSchool*MaxOfSurvivalToGrade*MaxOfCanRea dCum/10000

Any insight would be greatly appreciated--I just can't understand why Access would suddenly refuse to do math.

View 1 Replies View Related

Queries :: Adding Calculations To Queries Based On Columns In Query

Feb 18, 2014

I am trying to add calculations to queries based on columns in the query... it seems to randomly expect 'Expression' or 'Group by' as column types, and Im having to create 3 sets of queries following on from each other to de-dupe data and allow filters on calculated values.

Also I've got a function which turns a date into a quarterly cohort, e.g. Oct 2013 -> 20134. I use ot on a lot of dates. I created a VBA function, CohortQ used as follows in queries:

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 CohortQ([InputDate]))

In the VBA, InputDate is defined as a date

Code:
Function CohortQ(InputDate As Date) As Integer
If InputDate = 0 Then
CohortQ = 0
Exit Function
End If

[Code] .....

But when I run it on a date field, it gives me a data mismatch error. I can't step through as it's working on 600K rows.
If I put the function into the query,

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 Year([InputDate])*10+DatePart("q",[InputDate]))

it works.

View 3 Replies View Related

Calculations On Main Form Do Not Reflect Calculations On Subform

Sep 28, 2015

I have solved the problems getting values on the subform. I have not in getting values on the subform.For instance, on the one titled phone use the formula in the tutorial is:

=[sbfCustomerRoomUse].[Form]![txtTotalPhoneUse]

#Error results when the doc is put into a form mode.

Now when I input each value in the equation above separately.I still get no entry.

For " = sbfCustomerRoomUse" , I get #Error;
and for "= txtTotalPhoneUse", I get #Name.

CustomerRoomUse and txtTotalPhoneuse are from the subform that was dropped into the customer form in a previous step. It shows that explicitly when designed sbfCustomerRoomUse on the main that CustomerRoomUse come from a subform. This does not seem to need to be done with txtTotalPhoneuse, and I am not sure why. Neither one gives me a desired calculation result.

View 14 Replies View Related

Help Implementing A Neat Idea

Jan 13, 2006

I’m working to ever-improve a Help Desk-like database and I got this idea for “templates.” That is, a quick way to fill out the as much of the ticket form as possible when common issues come in.

So I’ve created a table (Templates)that mimics the structure of my ticket table (Incidents). I’ve gone into Templates and put the values I want automatically entered in each field and I’ve added a combo box and a button on my ticket screen. The combo box is populated, from Templates, with the name of each Template.

My problem is that I have no idea how to make each field on the Incident form populate with the values from the Template table.

Any help would be greatly appreciated!

View 7 Replies View Related

Queries :: Run To Extract Some Values For Calculations

May 12, 2015

I have a query that I run to extract some values for calculations. Its run on an event based on a dropdown selection. At the moment, I run via:

Code:
DoCmd.OpenQuery "CallMidprice"

and then close it. this seems to take more time than is necessary when I only want to refresh the results.Open query without close, switches to the table but doesn't update until I press F5.When I try requery I get an error. "Runtime error '2109': There is no field named 'CallMidprice' in the current record.

Requery without 'Callprice' seems to requery my form.

View 5 Replies View Related

Queries :: Calculations On Query Results

May 20, 2013

I need to do a calculation on the RESULTS of a query. Each record in the table I'm querying has a date stamp. I have a query that produces a list of the newest records for each machine. I want to calculate how old each of those records is based on today's date.

So far when I try to include the calculation in that query, it returns all the records instead of the newest ones. This makes me think I'm doing something fundamentally incorrect. The calculation is affecting the query results where I just want to do the calculation on the results. What I'm trying to ultimately do is have a way for the users to see a list of machines that are overdue for a certain procedure. I was thinking of putting a button on a form that will run the query and present the list, perhaps with some conditional formatting highlighting the machines that are overdue, etc. Do I need to just use 2 queries?

View 14 Replies View Related

Implementing Authorization Code Functionality

Jul 23, 2006

Hello Access Gurus,

Our application can be broken into several modules, and we want to be able to shut off all modules, but then activate them by entering an Activation/Authorization code for each module.

The issue is that I'm fairly new to Access, and have never done this type of functionality. Is there anyone out there that has done this and can give me some guidance? I would greatly appreciate it.

Thanks in advance.

View 4 Replies View Related

Decrease In Performance After Implementing Security

Sep 14, 2006

Have you experienced major decrease in performace after implementing Security in Access? (Note: the database is not encrypted.)

View 6 Replies View Related

Implementing Calendar Functionality With Outlook?

Feb 6, 2014

A client I am working for wants a calendar to interact with their database forms, I am thinking outlook would be the best bet, as a table and form to make my own in access would be overly complicated. Is there any way to embed a calendar from outlook within an access form?

View 1 Replies View Related

Calculations In Access

Aug 24, 2005

I need to be able to use some functions available in excel in an access 2000 database. These include SUM and IF functions. If any one can help me figure out how to do this any help help wouold be greatly appreciated

View 6 Replies View Related

Calculations In Access???

Feb 18, 2007

Hi

I am currently setting up a data base for my work and was wondering if there is any way to do the following calculation:

I have a database of automatic doors that are contantly being repaired and i want to keep a record of the accumulated costs involved with this.

I have set up a form to update each door and its accociated repair cost, the problem is when i enter the new repair cost access replaces the current cost with the new and i want it to be added to the current cost so the accumulated cost can be bulit up over time.

I hope this makes sense

Any help would be greatly appreciated!!:)

View 10 Replies View Related

Calculations In Access

Dec 5, 2007

Hi
Since this is my first attempt at creating a database and I must admit I am needing a wee bit of help with doing a calculation

I have created a database and need to create a Query I think, to calculate the number of places available the maximum places in each group would be 20 and obviously a count of the people going onto each group would be subtracted from the Max places available this would then need to update the available places . I just cant think how to do this any idea would be a great help.:confused:

View 2 Replies View Related

Queries :: Lookup And Calculations Between 2 Queries?

Jun 20, 2014

I have 2 queries 1 called [Prod Performance]

the second query is called [Shifts]

Field within [Prod Perf] which I want to use is called [Prod Date] & [Hrs]

Field within [Shifts] which I want to use is called [Shift Date] & [Shift Total]

I need a query to compare dates which match from both queries and then divide [Shift total] / [Hrs] to give a number.

View 1 Replies View Related

Queries :: Calculations With Values In Previous Record(s)

Jan 12, 2015

I have a database where I need to record student data, specifically marks and absenteeism. The marks are recorded each term as a running total. I have a final mark which needs to be equal to the 4th term mark.

I also need to record the number of days absent each term with a total at the end of the year.

My problem is that the term 4 mark is a in the previous record and the total days absent needs to be the total of the previous 4 records (term 1 - 4).

I using a create table query and an update query but that was a no go.

View 7 Replies View Related

General :: How To Use VBA In Case Of Complex Calculations Instead Of Queries

May 29, 2014

i just know some query designing and some amount of VBA for making small event procedures.I want to know how we can use VBA when our queries becomes complex to replace the queries and to extend the functionality.how to use recordsets in a VBA function.

View 5 Replies View Related

Queries :: Getting Required Data Using Query For Calculations To Be Used Later?

Nov 7, 2014

I've been trying unsuccessfully for weeks to try and query a usable data set that would later be used for calculated values in a report.

I'm building a Hospital Acquired Infections Database for my facility to record data and process reports automatically. Previously, I built the system in Excel using VBA and userforms, but the size of the file has become too cumbersome, and now takes too long to process my reports.

So here's the issue.

UNIT_DATA TABLE:
UNIT
INF_MONTH
INF_YEAR
PT_DAYS
CVC_DAYS
IUC_DAYS
VENT_DAYS
APV_DAYS

PT_LEVEL TABLE (There are many fields in this table for recording purposes but I will only list the ones I need for reporting purposes):

UNIT
INF_STE_MAJ
SPECIF_SITE
INF_MONTH
INF_YEAR

So the important numbers I can't seem to collect are the total number infections per month from the PT_LEVEL Table for only select SPECIF_SITE infections.

the Tables are joined Left to Right as Follows:

UNIT_DATA.UNIT - PT_LEVEL.UNIT
UNIT_DATA.INF_MONTH - PT_LEVEL.INF_MONTH
UNIT_DATA.INF_YEAR - PT_LEVEL.INF_YEAR

The UNIT_DATA Table is a monthly collection for the 5 metrics (PT_DAYS, CVC_DAYS, IUC_DAYS, VENT_DAYS, APV_DAYS) regardless of whether or not the number for each is zero. Every unit in the database will have a record for each month and year.

The PT_LEVEL Table will only have records if and when a patient develops an infection. This means there is no cumulative monthly data for the PT_LEVEL Table Data based on SPECIF_SITE infection type.

I need to first do a roll up count for every month and year in the database, for which I was initially trying to use the UNIT_DATA table for since it contains every month and year. The problem is when I try to query the SPECIF_SITE from PT_LEVEL, I can get the number of Infections for months where infections where present for each unit and null values, for each month, and each year in UNIT_DATA, but when I include a where condition to narrow the view to only selected SPECIF_SITE's it only shows data for that SPECIF_SITE for months where they occured.

I need a cummulative monthly aggregation of the totals for a selection of SPECIF_SITE infections, for every unit, for every month, and every year, since July 2010.

View 14 Replies View Related

Queries :: Applying Calculations To Date Ranges

Aug 10, 2015

I need a query that will relate values to given date ranges. For Example:

Table: TaxTypeRange
Values:
TaxType; FromDate; ToDate; Contact
W2; 1/1/15; 3/31/15; Tom
1099; 4/1/15; 6/30/15; Tom
W2; 7/1/15; 12/31/15; Tom

Table: Bills
Values:
Contact; BillAmount; BillDate
Tom; 1000; 3/31/15
Tom; 1100; 4/30/15
Tom; 1200; 5/31/15
Tom; 1300; 6/30/15
Tom; 1400; 7/31/15

Requirement: For every period where the TaxType = W2 the query should multiply the Bill amount by 1.20, so the result should be something like this:

Query: BillsAndTax
Values:
Contact; BillAmount; BillDate; TotalBill
Tom; 1000; 3/31/15; 1200 (TaxType = W2 so 1000* 1.2)
Tom; 1100; 4/30/15; 1100 (TaxType = 1099 does not apply 1.20)
Tom; 1200; 5/31/15; 1200 (TaxType = 1099 does not apply 1.20)
Tom; 1300; 6/30/15; 1300 (TaxType = 1099 does not apply 1.20)
Tom; 1400; 7/31/15; 1680 (TaxType = W2 so 1400 * 1.2)

Not sure how to set this up the right way.

View 3 Replies View Related

Queries :: If Function - Calculations Based On Field

Dec 15, 2014

I would like queries to do some calculations for me based on a field. The field in the form is a combo field and the user can choose either 1, 2 or 3. Based on the selection, I would like queries to generate some numbers for me.

This is what I have in mind but its not working.

Code : TEST RESULT: If([tlkpTEST].[RESULTID])=1, ([tlkpTEST].[RESULTID])*2, 100)

View 2 Replies View Related

Access Form Calculations

Sep 19, 2006

Dear All, i have a very simple database with only one table.

The table has three values [Start], [end] and [Total].

The [start] & [end] fileds are numerical.

I am trying to get it so that i can enter the values onto a form, the two values in [start] and [end] need to be added together to give the [total] value.

I can get it to do it on the form but i don't know how i can get the record in the table to be updated.

Does anyone know if this can be done and if so could you advise me where i'm going wrong.

Any help would be most appreciated.

View 5 Replies View Related

Access Form With Calculations

Oct 16, 2006

I have created a form in Access to enter data into a Table. But one of the firelds I need to enter into the Table is calculated from some of the data being entered in the form. I currently use an Update Query to go back and do the calculation and then update the appropriate field. What I would like to do is to do the calculation and update the calculated field while the user is entering the data. (Boy I hope this is making sense!)

If it helps understand what I am trying to do here is an example: The user is entering data for a job we produced. Some of that data is NumberOfPages, PaperSize and JobType. But I also need to take those three pieces of info and calculate the number of square inches. Currently I run a function I wrote via an Update Query that updates the SquareInches field in the table. I was wondering if there was some way to do the calculation on the fly and enter the calculated value into the table while all the other data is being entered. I tried writing a little code to attach to one of the field's OnExit event but I seem to be having a problem getting the values from the fields I have already entered.

If anyone has any suggestions I would sure appreciate hearing them. Thanks!

View 7 Replies View Related

Date Calculations In Access

Sep 10, 2015

I am building a database and in it I need to do date calculations. Without too much detail I input a date based on the built in calender from the date/time field and based on that date I need to have the following data returned into other individual fields: 6 months from that date, the days until that date, 2 months from the date input, 4 months from the date input, 5 months from the date input, 60 days from the end date, 45 days from the end date, 30 days from the end date, and 15 days from the end date.

Example: I input "Sep 10, 2015" and I would get "Mar 10, 2016", "181 Days", "Nov 10, 2015", "Jan 10, 2016", "Feb 10, 2016", "Jan 10, 2016", "Jan 25, 2016", "Feb 9, 2016", "Feb 24, 2016".

I have read through websites regarding date calculations within Access but I cannot find the specifics for the application that I need.

View 5 Replies View Related

Queries :: Keeping Records Of GST Transactions - How To Do Calculations In Query

Apr 5, 2013

I am trying to keep records of GST transactions.

I have a problem in figuring out how to do calculations in a query.

How to have the calculation in the attached MDB and Document for field #105_SubTotal and the field #115_PaymentEnclosed.

View 7 Replies View Related

Queries :: Timesheet Calculations - Round Up To Nearest Fifteen Minutes

Sep 2, 2013

I have a timesheet database, which has the exact start time and exact end time. I want to ignore this if it is five minutes either side of the half hour, and display the exact half hour, but otherwise want to round it UP to the nearest fifteen minutes.

For example:

Exact Start: 09:58:23 Displays as: 10:00:00
Exact Start: 09:42:16 Displays as: 09:45:00
Exact Start: 09:02:08 Displays as: 09:00:00
Exact Start: 09:07:01 Displays as: 09:15:00
Exact Start: 09:23:03 Displays as: 09:30:00
Exact Start: 09:33:00 Displays as: 09:30:00
Exact Start: 09:36:04 Displays as: 09:45:00

View 11 Replies View Related







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