Queries :: Query Correct But Report Wrong?

Aug 3, 2015

Query 1: has all the data (description, account, amount).
Query 2: sums Amount by Account No.
Query 3: combines Query 1 and 2.

Query 3 also has a join by the Account No. There is a report based on query 3.

Issue: I can run query 3 to equal 0 and generate the report correctly but when I generate the query to not equal 0 the report brings in all the data.

View Replies


ADVERTISEMENT

Queries :: 2 Inputs For Same Field - Query Result Not Correct

Sep 4, 2014

I have a query that allows 2 inputs for the same field ( batch no )

if you enter "pco0093" only you get 4 results
if you enter pco0094 only you get 4 results

both have the same part numbers is the results

When I run both together pco0093 and pco 0094 and use the "group" function on the field batch no I get 8 results ( as expected)

if I use the " where" function I expected to get the 4 results but with the " quantities doubling

What I am getting is more than 4 results but 5 with a part that was not on any of the single results

File attached ....

View 9 Replies View Related

Queries :: Select Query - Count How Many Records Not In Correct Format

May 7, 2013

So I have a table with around 20,000 records and there is a field which holds a phone number for each individual within the organization, I want to run a select query that counts how many are not in the correct format

The format is 10 digits and it must start with a 0

Using Access 2010

View 2 Replies View Related

Queries :: Query Returning Wrong Results?

May 7, 2014

I have two tables Contacts & Allowance. There is a relationship defined between the two based on Contact ID (primary field/contacts - foreign key/allowance). The Contacts table has Firstname + Surname. I have produced a query based on certain fields in both tables however the result is totally pulling incorrect info.

View 11 Replies View Related

Queries :: Query Returns Wrong Values

Aug 30, 2014

My problems is that when I use below setup without the "Notes" tabel, they query works fine, and returns the amount of spares and time used by a single WBS ID. (Customer). But when I add another tabel and link it together. Its returns load of lines with the same data - it looks like its copying its self, over and over again.

View 4 Replies View Related

Subform Correct Answer Adds To Number Correct In Main Form

Mar 2, 2012

The code I have is.

Code:
Private Sub Command26_Click()
If Forms![test site]![prp test].Form.[A Right Answer] = -1 Then
Forms![test site]![number correct] = Forms![test site]![number correct] + 1
End If
DoCmd.FindNext
End Sub

Then when clicked it checks a yes/no box to see if "A right Answer" is the correct yes. Then it should pop to the main form and take the number correct cell and add one to it. I am trying to get the record to go to the next record inside the sub-form but docmd.findnext seems to be wrong too.

View 4 Replies View Related

Wrong Totals On Report

Sep 13, 2006

Hi there.
I have a report which has multiple pages with multiple running totals. It is an invoice style report producing an invoice run for all customers at once. The invoice detail lines are a subreport for each customer. Every time a customer changes a new invoice page is produced (grouped by customer). If there are no invoice detail lines for any one customer a total is still displayed using the IIF command to avoid #Error totals. A running GRAND total of ALL the invoice totals is displayed as a report footer. The problem I have is when I generate the preview report and flick to the last page to see the grand total it is there no problems. However, when I print it I get a different amount!!! If I then start leafing back through the invoices on-screen - say 20 - 30 customers - then go to the end again the grand total changes again! I know the grand total shown initially, when going straight to the end is correct as I have checked it with queries. The report is 630 pages long. Any ideas as this is driving me nuts! (I assume it has something to do with using the IIF statement or perhaps the subreports?)

View 1 Replies View Related

Reports :: Data Correct On Report View But Not When Printed

Jan 8, 2014

I'm tracking some charges and want to report them based on month/year and an Early/Late (yes/no) flag within the query I created. When I wrote the report I grouped on mon/year then on Early/Late, then calculate averages. I then want to calculate the difference in the charges between the Early & Late rows. Here....

Jun 13
32 868 27 (Early row #, charge, avg)
11 1279 116 (Late row)

Now I want to subtract the 27 from the 116. I figured out I could assign the 27 to a field in the header and the 116 in the footer, that's the only way I could make them "stick". I then calculate the difference and things are great. Until I try to print it. When I print the difference is 0 because the group header & footer fields are both populated with the 27.

View 14 Replies View Related

Modules & VBA :: Report In Wrong Order

Feb 26, 2015

I have a cool little form for the use of the organization's treasurer wherein she enters checks and deposits. I have a query that generates a running sum, so each line in the accounting report based on the table has the account total as of that date. The query behind the report is exactly what I want and is in the correct order. For example, the four transactions for 9/15/2014 are in the order entered, and the line total is correct. The report insists on listing the 4 in the example in some other order with or without OrderBy specified. With code from someone, perhaps on this forum, I added the following to the OnPage event:

Code:
Private Sub Report_Page()
Const TWIPSPERINCH = 1440
' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer

[code]....

The result is a beautiful report (albeit in the wrong order) with vertical lines all the way to the bottom of the page.If I remove the OnPage code, the report is still in the wrong order, so obviously that wasn't the problem. OK, I think it is corrupted. I open a new db, import all into it. Still in wrong order. So next, I begin to recreate the report from scratch. Hooray! Right order! But I still want the vertical lines between the columns. So now, I copy the OnPage code and paste it into the new report's OnPage code. I get error message: "Compile error: User-defined type not defined" with the line "Dim MIPSstr As udtPrtMips_str" highlighted. Ok, I delete all of it and reenter it line for line manually, leaving out the comments. Get the same error message. After trying to research it, the only suggestions were to add Activex reference which can't be the problem, because the other version of the report doesn't throw an error and both are in the same db.

I have attached a clip of the report and a clip of the underlying query. As you can see in the first capture.png, the check numbers are in the wrong order and the amounts in the Total line don't sync with the total above adjusted by the amount on that line.

View 3 Replies View Related

Reports :: Booking Sequence - Report Not Generating From Correct Form?

Oct 7, 2013

I have a booking sequence. Sales representatives take an order on a booking form and then then click a button to draw up the related report. The form is showing all Booking forms, not the specific one just taken.Do I need an OpenArgs statement? I've tried that but can't seem to get it to work.

View 10 Replies View Related

Reports :: Report Keeps Referring To Wrong Field?

Sep 30, 2013

I have a query[view] where I have six employee numbers, I left join these to an Employee table to retreive the names.

I've created a report that uses this query/view as its source. For some reason my report keeps making all six name fields refer to the same control source Employee.Name and not Employee_1.Name, Employee_2.Name, Employee_3.Name,.... respectively.

In design view everything looks fine but when I switch to report view the switch happens, it displays the same name in all fields. When I switch back to design view all of the fields have changed to the same control source.

why this is happening? My tables are in a SQL server.

View 10 Replies View Related

Queries :: Nested IIF - Not Getting Correct Value When Add Second Condition

Oct 24, 2013

I am using the IIf function as follows

Exp1:IIf(field A = "a string value",1,0) this returns the correct value.

However when I try to add a second condition using the IIf function, or use the And Or condition, I do not get the correct value.

I am trying to get a value of 1 in the Exp:Col when field B has a value that is different from field A.

What is the correct syntax? What am I missing??

View 13 Replies View Related

Queries :: Correct Syntax / Expression For Log Of Number

Mar 23, 2013

Correct syntax/expression for log of a number. The number i am getting in Access is twice as big as the correct number i get in excell

View 3 Replies View Related

Queries :: Utilization Report - Multiple Query Into One Report

Sep 2, 2014

I have a three-column query that tells me how many hours I have available per week for a given resource type (e.g. welders). I have a second three-column query that tells me how many hours of work I have planned per week for a given resource type.I'm hoping to produce a query (the source for a report) that will show resource types in rows and twelve months in 24 columns. the first column for each month will show how many hours I have available for all my resources, the second column for each month will show how many hours I have allocated.

How do I produce a query that will combine the other two queries, inserting zeroes where necessary considering that for any given week I might have allocated work to a resource that isn't available (because the inconsiderate buggers think they are entitled to holiday) or I might have a resource that has no work allocated (because I'm incompetent)?

View 8 Replies View Related

Queries :: Count Can Be Displayed From Collection Table Next To Correct Site Name

Sep 12, 2014

I have a master table with all of my Site Names in it. I have a collection table that when a barcode is scanned it records the site name as being received. I built a query that counts the number of times the site name has been received.

What I want to do is list all of my sites from the master then display the count next to the corresponding site name. This will identify those sites that did not send in an item. Is there criteria in the query I could use so that 1) I could list all of my sites from the master table and then the count can be displayed from the collection table next to the correct Site Name?

View 4 Replies View Related

Queries :: DCount Function Returns Correct Result But Datatype Is Text

Feb 4, 2015

I am using the dcount function as the example I display below. The problem is that it returns the correct result (i.e. 59) but the data type is text (59 is on the left side) . I need this to be number.

=DCount("[OrderID]", "Orders", "[ShipRegion] = 'CA'")

View 3 Replies View Related

Query Not Returning Correct Results

Jul 3, 2006

Hi everyone,

I'm having an issue with a query I created. When run the query requests an Artist Name. I enter this and it returns one result. However in actual table ther are two results for that artist. The only difference is that for the record that doesnt appear the field labelled "Gallery" has a zero value.

I have checked the table and the gallery field is not set to a required field so I dont understand why it wont show it as a result of the query.

Any ideas?

View 3 Replies View Related

Correct Join Type And Query Statement

Feb 7, 2006

I've been struggling with this for awhile now. I've been trying to research a solution but I'm not even sure what to search for.I have the following table structure:tblContactsContact_ID (PK)First_NameLast_NametblBidPackBid_Pack_ID (PK)Bid_Pack_DescriptiontblDistributionListList_ID (PK)Bid_Pack_ID (FK) (1-M)Contact_ID (FK) (1-M)What I would like to do is create a query to display all of the contacts from tblContacts that are not associated with a certain Bid_Pack_ID. My end goal is to create a form where I enter Distribution List Information. I want a listbox on the left with all of the contacts from tblContacts and a listbox on the right with contacts that have been selected for a particular Bid_Pack. When the user double clicks an item on the left it should show up on the right and be removed from the left. I'm looking for the same functionality as when you use the design wizard and you choose fields to include/exclude.For example, let's say I want to add contacts for distribution list "A". My thought is the box on the left would show all the contacts from tblContacts that aren't selected for distribution list "A" and the box on the right would show all of the contacts that are part of distribution list "A". As you double click an entry it would perform the appropriate record creation/deletion and each box would be required.So back to my original question, what is the correct method (relationship, join, querydef) to select all of the contacts from tblContacts that haven't been assocatied with a particular bid pack?Thanks for any help you can provide. Even a nudge in the right direction would be appreciated.

View 2 Replies View Related

Query Not Finding All The Correct Unmatched Records

Mar 31, 2006

I have several tables that I am trying to get information from:

Clock Number Table with fields: Clock #, Name, Title, Dept, Term, HireDate, & TransDate.

Completed Training with fields: Clock #, Data Completed, Doc # & Rev Level

Linked Table, Controlled Documents with fields: Doc #, Title, Effective Date & Rev Level

Linked Table, Distribution Table with fields: Doc #, Distribution, Rev Level & Effective Date.

Some of the tables have more fields that those listed, but they do not pertain to this query.

I am trying to create queries that will provide me with the names of employees who have not been trained on Controlled Documents that have been distributed to their department.

So far, I have been able to determine if no one has been trained, but if even one person has been trained, they do not appear on my list. I would like to know the Clock # and name of those that have not been trained.

I have created 3 queries to get this far. Query 1 is the Clock # Table and the Completed Training Table joining the Clock #. Query 2 is the Controlled Document Table and the Distribution Table joining the Doc #, Rev Level. Query 3 takes these queries and joins Doc # and Rev Level. and pulls records where the Rev. Level and Doc # is Null.

View 2 Replies View Related

Accessing Correct Combo Box Column From Query

Jan 4, 2008

Hi everyone,

I have a combo box that is populated from a table called tblProducts.
There are only three fields ID, Model and Description in this table.

ID is the primary key field and is an Autonumber

In the form when a user selects a product from the combo box the "Model" fields is displayed which is how I want it.

I am doing a query that should show the "Model field however when I run the query it shows the "ID" field which is useless information for the end user.

How do I show the correct field in the query?

View 7 Replies View Related

Correct Week Number Format In A Query

Jan 6, 2005

Wondering if anyone can advise...

The 1st/2nd Jan of this year were treated by most people as still being week 53 of 2004, and week commencing 3rd January being week 1 of 2005. In VB I have a formula to do this:

WeekNo = Format(Now(), "ww", vbMonday, vbFirstFourDays)

However my problem now is that I need to replicate this format in a Query within Access. The formula

WeekNo: Format(Date(),"ww")

treats 1st/2nd Jan as week 1, the 3rd as week 2 etc. Any idea how I can get it to treat 3rd Jan as week 1 instead?

There's a challenge for someone!! Help appreciated.

View 1 Replies View Related

What Is Wrong With This Query?

Jan 15, 2007

SELECT s.weekth, s.contracttype, sum(case when s.[contract status]='advance complete' then price end)/sum([purchaing price])

from submissionandpd as s

THX

View 5 Replies View Related

What Wrong With This Query

Jan 22, 2007

t2 is a subset of t1, I want t1-t2.
but following code does not seem to work.


SELECT *
FROM t1
except
select *
from t2

How to fix this problem? Thanks.

View 1 Replies View Related

What Is Wrong With This Query?

Mar 14, 2007

SELECT Orders.DelAdd1 AS Street, Orders.DelAdd2 AS [Street 2], Orders.DelTown AS Town, Orders.DelCounty AS County, Orders.DelPostcode AS Postcode, Sandwich.SandwichName AS Sandwich, sum(Orderline.Quantity) AS Quantity
FROM Orders, Orderline, Sandwich
WHERE Orderline.Sandwichno=Orders.SandwichNo and Orders.DeliveryDate=[Please enter Today's Date]
GROUP BY Orders.DelPostcode;

It says I've not specified street as an aggregate function, but I don't want to!

View 1 Replies View Related

What Wrong With My Query

May 15, 2007

Hi Guys,

what could be the probelm with my query? Here:
******************
SELECT tblPartnerProfile.PartnerType AS [Org Type], tblPartnerProfile.PartnerName, tblPartnerProfile.PartnerLoc1, tblPartnerProfile.PartnerStatus AS Status, Count(PartnerType) AS TotalType,
FROM tblPartnerProfile
WHERE PartnerLoc1 = 1 OR PartnerLoc1 = 2
******************************
I would like to have it give a count of how many [Org Type] 1 and 2 for Loc1 1 and Loc2 2.

Thanks in advance,

Samia

View 4 Replies View Related

What Is Wrong With This Query

Jul 24, 2007

Hello,
I have a Query that I wrote as follows:

SELECT [TableA].[FieldA], [TableA].[FieldB], TableB.FieldC
FROM [TableA],TableB
RIGHT JOIN [TableA] ON [TableA].[FieldB] = TableB.[FieldD]
GROUP BY [TableA].[FieldA], [TableA].[FieldB], TableB.FieldC;

What happened was that TableA has Fields A and B, and Table B has a field C and D. Tables B and D have the same content (Not necessary unique) and I would like to see a mapping from Field A -> Field C by joining on Field B and D.

However, when I ran it, I got an "invalid arguement" error.

Could anyone help? Thanks a lot!


Regards,
Anyi

View 1 Replies View Related







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