Including Details From Query Calculation

Aug 1, 2006

Part of a database I'm developing stores details of events. Each event is funded from a variety of different sources.

There are three tables involved in making this work:
tblEvents - which stores the main event details
tblFundingOptions - which stores all the possible funding sources
tblEventFunding - which links the two together.

I have created a form to access all of this, with the information from tblEvents at the top and the Funding details on a subform.

I have created a query based on tblEventFunding which adds up the total amount of funding allocated to each event. I want to display this total on the form I've developed.

Can I do this without creating a second subform to pull the details in from the Query? I've tried creating a text box and linking it to the appropriate query, but it just displays #Name! - presumably because it doesn't know which record from the Query it should display, and I don't know how to tell it!!

Is what I'm trying to do possible, or do I need another subform?

Many thank in advance,

Gary

View Replies


ADVERTISEMENT

Queries :: Date Range Calculation Including Partial Months

Aug 28, 2013

Trying to get a formula or function for calculating profit for each month between selected dates. Partial month calculations are required.

Source Data (record) examples:
Contract1: Startdate = 6/30/12; EndDate = 9/22/12; DailyProfit = $500; MonthlyProfit = $9500
Contract2: Startdate = 7/7/15; EndDate = 12/17/12; DailyProfit = $600; MonthlyProfit = $11400
Contract3: StartDate = 8/1/12; EndDate = 6/30/13; DailyProfit = $350; MonthlyProfit = $6650

User Query #1:
Notes:
ReportStartDate will always be entered as the first day of the month;
ReportEndDate will always be entered as the last day of the month
The report will always show 6 consecutive months

User selects
ReportStartDate = 7/1/12;
ReportEndDate = 12/31/12

Notable conditions:
-The calculation for Contract 1 will have a partial month profit calculated for September 2012. The other months can show the MonthlyProfit value, with October and December being $0.
-The calculation for Contract 2 will have a partial month profit calculated for July 2012 and December 2012. The other months can show the MonthlyProfit value.
-The calculation for Contract 3 will have no partial months since the StartDate is on a month beginning, and the ReportEndDate is prior to the EndDate. July 2012 will show $0.

Request: I either need a super complicated IIF statement for 6 fixed columns in a query (one column for each month) or a smart function, neither of which I can do.

View 6 Replies View Related

Query From (and Including) Date - Thru (and Including) Date

Jun 16, 2006

Access 2000
Hi All.

I am running a select query on a date field.

I populate the table "date" field from a Microsoft Date and Time Picker Control 6.0(SP6).
I havent been able to figure out how to ONLY populate the date portion of the control so my field value containes Date & Time.

When I run the query, I have to select the day after my request to include the records I need. I think this is because of the time in the field
Example, If I want all records thru 6/17/2006 I must select "thru" 6/18/2006. This mucks things up if I have records dated 6/18/2006

Both of these statements give the same bad results:

Between [forms]![freports]![from] And [forms]![freports]![thru]

>=[forms]![freports]![from] And <=[forms]![freports]![thru]

Any ideas?
TIA
Detrie

View 1 Replies View Related

Query Not Including All Data

Jul 31, 2006

I currently have a query set up to pull information from 4 linked tables: Event, Readers, Class and School. The Event table contains a ClassID and a ReaderID. If everything has been assigned properly, there's no problem. If there's no reader assigned to ReaderID I still want the event details to be included in the output. Right now it's not. I'm pretty new to Access so if anyone can help, that'd be great. If you need to be try to explain further, let me know.

View 4 Replies View Related

Queries :: Including (In Between) Information In Query?

Sep 3, 2013

I have a table of events that includes fields for ages, a Start Age and a End Age.

I want to make a query that pulls up how many programs have been provided to a given age group. How can I make it so that the query will understand to include records that have the given age group in between the Start Age and End Age fields? I.e. if I set the query to 3rd Grade, records that start at 2nd Grade and end with 4th Grade are included in the results as well.

View 7 Replies View Related

Including Columns With No COUNT Values In Crosstab Query.

May 6, 2007

I have a columns that do not incur a count value within the time period of my query, yet i still want them to be displayed with a 0 or no value in the query view, how do i do this?

View 1 Replies View Related

Queries :: Converting Mmmm Yyyy To Including All Dates In That Range In Query

Oct 14, 2014

My table has many records for each month. I am creating a report that will display only the records in one month of a year. I have been able to create a form that gives the user the choice of the Month and Year for which to create the report. The code I am using to create the combo box is:

Code:
SELECT DISTINCT Month([QTDate]) AS MoNum, Format([QTDate],"mmmm yyyy") AS MoName
FROM MainTBL
ORDER BY Month([QTDate]);

What I need to do now is create the query for the report that displays all records for the chosen month and year. If I simply reference the combo box, all it shows is mmmm yyyy and the days are missing so the query doesn't work. What do I need to do to create the query so it displays all days within the month and date selected?

View 6 Replies View Related

Queries :: Date Criteria - Query Previous 12 Months Including Months With No Data

Mar 22, 2013

I currently have a form where users can enter an "End Date", click a button, and it queries the data from 12 months prior to "End Date" entered.

Is there a way to force the query to show all 12 months, even if there are no records for a particular month? For example: if the user enters February 2013 in the date field, I would like the query to return:

March 2012
April 2012
May 2012
June 2012
July 2012
August 2012
September 2012
October 2012
November 2012
December 2012
January 2013
February 2013

...so even if June 2012 has no records, it is included in the query with a value of zero.

This is what I have so far:

WHERE (((Qry_Tbl_Assets.Dte) Between DateAdd("m",-12,[Forms]![Main_screen]![End_Date]) And [Forms]![Main_screen]![End_Date]))

View 2 Replies View Related

Counting Including 0

Feb 24, 2006

I need to run a query counting how many policies a client cancelled. But I need the query to include zeros. Is this possible?

Here's my SQL Statement currently.

SELECT DISTINCTROW Pqry_CancelledPolicy01.Number, Pqry_CancelledPolicy01.Name, Pqry_CancelledPolicy01.POLICY_STATUS, Count(Pqry_CancelledPolicy01.Number) AS CountOfNumber
FROM Pqry_CancelledPolicy01
GROUP BY Pqry_CancelledPolicy01.Number, Pqry_CancelledPolicy01.Name, Pqry_CancelledPolicy01.POLICY_STATUS
ORDER BY Pqry_CancelledPolicy01.Number;


Thank you in advance for the help.

View 1 Replies View Related

Including Photos In Database

Mar 4, 2008

I've got a database that tracks name/address/phone, etc for a large group of people. I've recently added the ability to include a person's photo on the forms and reports. I've done that by saving the photos with the naming convention of [firstname]_[lastname].jpg and then using VBA, the database checks to see if there is a file with the corresponding name of the record and displays the picture if so.

It works very well, but I can see where I would have some problems in the future. For example, if someone gets married and changes their name, the corresponding photo must also be renamed to display properly. And if there are any misspellings, that becomes a problem. Also, if James decides he wants to go by Jim, the photo would not be displayed, either.

I'm wondering if anyone has any other ideas on how I might accomplish my goal. I know I could name the photo based on the record ID, but that's not a good option, since I'll be handling the photos, while someone else will be inputting the contact details. So I won't know the recordID easily.

Is there some way to have another field in each record that points to the corresponding photo? Then if James goes by Jim, his first name can be changed, but the corresponding picture name could remain the same.

Is there some great idea that I'm missing that would make this process much simpler and scalable? Or do I just have to deal with the maintenance issues?

Thanks.

View 7 Replies View Related

SQL Not Including Records W/ Empty Fld

Jan 9, 2006

Can anyone tell me why this sql is not returning all fldProjectID's for selected fldProvinceID regardless of whether a date exist for that fldProjectID in fldReportRec_D??

SELECT tblProject.fldProjectNo, tblProject.fldTitle, tblProvince.fldProvince, tblReport.fldReportRec_D AS [Monthly Status Report]
FROM (tblProvince INNER JOIN tblProject ON tblProvince.fldProvinceID = tblProject.fldProvinceID) LEFT JOIN tblReport ON tblProject.fldProjectID = tblReport.fldProjectID
WHERE (((tblReport.fldReportTypeID)=1) AND ((tblProvince.fldProvinceID)=[Forms]![Form1]![cboProvince]) AND ((Month([fldReportRec_D]))=[Forms]![Form1]![cboMonths] Or (Month([fldReportRec_D])) Is Null));

thanks in advance

View 1 Replies View Related

Including End Dates Within Forms

Oct 19, 2007

Hi
I have set up a form to prompt for start and end dates so that users can input their own dates which will return a report that is based on a query. However if they enter 01/04/07 to 30/04/07 it doesn't include the last date.
I have tried putting the following into the query
Between [forms]![formname]![cbostartdate] and CDate[forms]![formname]![cboenddate]+#23:59:59# but I keep getting the following message when trying to access the form.

The expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables.

Can anyone help?
Thanks

View 11 Replies View Related

Sum Of 2 Columns In SELECT Including NULLs

Oct 5, 2005

Hi!
I want to add two columns a and b. However, there are rows in which EITHER a OR b is NULL. This should be handled as if the cell would be zero. Is there any way besides filling in 0s in the tables?

I tried
SELECT a, b,
IIF( a = NULL, b, IIF(b = NULL, a, a+b))
AS c FROM

but this doesn't work.

Any ideas?

Cheers
Tom

View 1 Replies View Related

Displaynig All Records Including Those With Null Value

Sep 18, 2007

I am very much an Access novice, and use the expression builders for my queries. I have a query based on a table and another query. The table lists station names and station numbers. The "base query" includes station numbers plus other data, so I join the two in order to display the station name.

I want to run a query that lists every station by name, then for each station tells how many occurrences of a condition are met in another field for that station. Problem is, if the condition is not met, the station is not listed in the query output, and I need to see the complete list of stations, even those that do not meet the condition.

Here's what i would like to get if there are a total of 3 stations in the population:

Station Name #of Blue Items
Station 1 100
Station 2 1
Station 3 0


Instead, I get:

Station Name #of Blue Items
Station 1 100
Station 2 1

Thanks in advance!
marigny

View 1 Replies View Related

I Need To Duplicate A Record Including The Subform

Mar 8, 2006

I want to be able to copy, or duplicate a record including all the associated records of the subform. The structure is the typical, ORDERS, ORDER DETAIL, PRODUCTS. I want to be able to copy a specific ORDER and generate a new one with all associates products. It would be nice to change one field (ORDER NAME), changing the ORDER name would simulate the "Save As.." command.

The end result would be a new Order identical to the first one (including all sub items) but with a different name.

Any suggestions?

Leonardo

View 2 Replies View Related

Installing Keys Including A Letter

Apr 16, 2014

I would like to start keys for different suppliers with different letters. For example a company named ABC would have product keys starting with a and then a series of automatically installed numbers. That is the series of keys would be a1, a2, a3, etc. and then a company named Village woud have keys v1, v2, v3, etc. How can I do this without having to manually install thousands of keys?

View 4 Replies View Related

Query Calculation

May 16, 2005

Hello, I have the following criteria for my Query >=0.8*[Projects]![EstimatedHours]. This tells me when we've used 80% of our actual hours. How would I go about the criteria line if I wanted it to return above >= 50% hour use, but below 80%? Thanks

View 1 Replies View Related

Calculation In A Query

Sep 8, 2005

I have a query that is built up of 5 fields with only the 2 below being visible. I am wanting to be able to calculate the total price for each pole no i.e. Pole no 01-02 total price would be £1441.79, What is the best way to do this? Sample data is shown below


New Pole NoTotal Cost
01-02.....£437.08
01-02.....£476.37
01-02.....£36.21
01-02.....£70.27
01-02.....£51.56
01-02.....£370.30
01-1.....£437.08
01-1.....£476.37
01-1.....£36.21
01-10367.....£493.43
01-10367.....£70.15
01-10367.....£76.51
01-10367.....£102.67
01-10367.....£87.54
01-10367.....£36.21
01-10367.....£51.56
01-10367.....£39.54
01-11448.....£437.08
01-11448.....£463.25
01-11448.....£493.43
01-11448.....£476.37
01-11448.....£70.15
01-11448.....£76.51

View 4 Replies View Related

Query Calculation

Dec 6, 2005

In qryAddticket, I am trying to calculate two conditions (see Condition 1 & 2)However, I am having a problem on the first condition because it is adding 8 hours when it shouldn't. Can someone help to either fix my code or write a new one?

Condition 1: If the day_of_wk is 1, calculate time-reg_time/60, If the day_of_wk is 1 and time is less than 0, calculate time-reg_time/60+24

Condition 2: If the day_of_wk is 2, calculate time/60, If the day_of_wk is 2 and time is less than 0, calculate time/60+24

My code: pre: IIf([day_of_wk]="2",[time]/60,IIf([time]<0,([time]-[reg_time])/60+24,([time]-[reg_time])/60))

Thank you very much!

View 2 Replies View Related

Calculation Query

Feb 26, 2007

I need to calculate the total cost of the order and enter this into the "CostOfOrder" field which you can see in the picture...

http://i13.photobucket.com/albums/a298/steve01/untitled2.jpg

I need to read all the orderlines for an order into a record set and calculate the cost for each orderline. I need to use a loop in VBA to add them all together.

Here is the query for inclusion in VBA...

Dim StrSQL As String

StrSQL = "SELECT orderline.qty*sandwich.price"
StrSQL = StrSQL + "FROM sandwich INNER JOIN orderline ON
sandwich.sno=orderline.sno"
StrSQL = StrSQL + "WHERE (((orderline.orderno)="
StrSQL = StrSQL & orderno
StrSQL = StrSQL + "));"

Do Until recordSetData.EOF
Total = Total + recordSetData.Fields(0).Value
recordSetData.MoveNext
Loop

I think the Query is correct, but where do I put this in the form (or where do I actually put it as I don't know!) to make it work?

Thanks in advance!
Steve :)

View 1 Replies View Related

I Need Help With A Calculation Query

Oct 19, 2004

Im building a database for a car dealership. what do i need to do to take how many times someones name comes up in a certain field in a table and show it as a number. I need to include this calculation in a subfrom on a form which displays "employee info" which is already stored. Basically i just need to take how many times there name shows in the salesman field and show it as a number.

thanks

please respond, URGENT!

View 2 Replies View Related

Formatting A Date In A String Also Including Text

Feb 2, 2006

Hi there,

I have to format a date following dd-mmm-yy in an expression also containing text.

Expr1: "Text" & " " Date()

Although separately formatting the date is easily done. I need to keep both int he same expression.

View 3 Replies View Related

Printing Report From Form Including Subform

Aug 31, 2006

Hi there,

I am trying to save my form that i have created as a report by right clicking on the form and choosing save as report. However, my form includes a subform but the subform does not show up in the report. Any ideas as to why this and how it can be shown????

Thanks in advance

Lucy

View 2 Replies View Related

General :: Including Custom Notes On Orders

Feb 24, 2015

I'm looking to simplify some aspects of our company's order database, including standard notes that appear on the sales orders that we send to customers. We have different lines of business and the notes vary. We currently have several reports, depending on the type of order, with the notes hard coded in labels. It's not an elegant, nor scalable, solution.

Our ideal solution: One order report only, with an option for the user to select one or more notes from a list when they enter the order. I'm thinking a popup form with a checkbox next to each note, where each checked note will print on the order report.

View 5 Replies View Related

Queries :: Including Date To Filter Records

Jul 1, 2013

I have a query that pulls scores for this month only for each class member. Problem is, I only need a count of these scores (per person) and because the date is in the query, it doesn't group the scores together and count them as one. i.e. it sees score 1 and score 2 as separate because they have different dates so they won't count together.

The only purpose of date in this query is to filter out only this month's dates. Is there some advanced query expression something or other that will tell it to leave date out of the count and only use it to filter?

View 2 Replies View Related

Modules & VBA :: Access Mailmerge To Word Including Image

Nov 25, 2014

I have a database of film events, for which i have to do posters.

With the click of a button on a form, access opens word and puts all the fields in, including a field called [photo], which is the name of the image stored outside of the database.

Is there a way of getting that image into the word Document with all the other fields? Or have I just wasted an afternoon....

View 2 Replies View Related







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