Queries :: Getting Two Lists In One Query For A Report
Dec 18, 2013
I need to get a query back that may have more than the given number of records on either side, but need to not duplicate in either of the two columns. Works better to show what I need, I think...
Query needs to return: PersID.....Name.....Assist.....Device
Base data looks like this (after using query with Person and AssistType and Device tables):
Assistance:
1.....Adams...Dress
1.....Adams...Bath
2.....Jones....Bath
3.....Case.....Dress
3.....Case.....Bath
3.....Case.....Feed
Devices:
1.....Adams...Walker
1.....Adams...Lift Chair
1.....Adams...Wheelchair
3.....Case.....Wheelchair
4.....Doe.......Walker
4.....Doe.......Cane
What I've been asked for is something that looks like this:
1.....Adams.....Dress....Walker
1.....Adams.....Bath.....Lift Chair
1.....Adams.....-----....Wheelchair.......... ===> Null or blank in the empty column is OK; I can work with those
2.....Jones.....Bath......-----.............................................
3.....Case.....Dress......Wheelchair
3.....Case.....Bath......-----
3.....Case.....Feed......-----
4.....Doe......-----.....Walker
4.....Doe......-----.....Cane
Regardless of join type, I get variants on:
1.....Adams.....Dress.....Walker
1.....Adams.....Dress.....Lift Chair
1.....Adams.....Dress.....Wheelchair..........
1.....Adams.....Bath.....Walker
1.....Adams.....Bath.....Lift Chair
1.....Adams.....Bath.....Wheelchair..........
I can print it with two subreports (one for each column), but that is running slower than I would like. It's workable if we absolutely have to do it that way, but I'd rather see if I can get it out in one query and use the grouping functions in the report (there are some other fields involved, but they don't really affect what I am doing here)
Is there any way to do a query (even a couple of queries if it takes that to set it up) that will give me what I am looking for?
View Replies
ADVERTISEMENT
Jul 29, 2015
I have been working with Access for some time managing some databases for my company. But now I have some problems making the database easier to use by automatically creating a Query based on different criterias.The code looks like this:
Sub Multi_value()
'Definitions
Dim strSQL As String
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Set db = Application.CurrentDb
[code]....
The problem is that the "Business Field.Value" is inserted into the Query-criteria with brackets which for some reason are not supposed to be there when I use the .Value-parameter instead of the "Business Field"-parameter.
View 8 Replies
View Related
Feb 26, 2015
I've been asked to edit a current report that lists our production in week number order. I need to look at way we can 'flag up' orders that are within a 4 week period from the current date.
For example,
10 Orders in total in our database. 5 of which are due the drawings back within 4 weeks from today (26/02/15). I'm looking for a way for the report to show the 5 orders as priority, either by formatting the orders in bold, a different colour or under their own heading/group.
View 14 Replies
View Related
Dec 2, 2014
In my table I have the following fields that are tick boxes
Vee
Cathedral
Round Bilge
Bilge Keel
RIB
Semi-Displacement
Keel
Lifting Keel
Each record can take a couple of these options. For example record 1 could be ticked for a 'vee' and a 'cathedral' whereas record 2 could be ticked for all of them.
I have been trying to use these to make a search form. I want to be able to chose on ie. 'Round Bilge' and it will search for a record that is ticked 'round bilge'. I have done this for both a combo box and a list box and have used the formula for each field [Forms]![Boatsearch]![hulltype]
When I have clicked run query I have an error message saying: 'This 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'.
View 3 Replies
View Related
Nov 23, 2013
I have run into some problems by comparing two lists. My project is to compare two lists and on the below listed criteria's and with the wanted results.
Criteria's:
1. Part
2. Colour
3. pcs.
Wanted results:
1. Equal match (same part, Colour and pcs (pcs difference above and equal 0)
2. Equal match (same part, colour but missing pcs. (pcs difference below 0)
3. Missing parts (difference in org. list - 1 and 2 query)
But already in the first part I run into problems. I do a query as below. (picture attached)
SQL code:
SELECT Parts_All.[Lego part], Parts_All.farve, Parts_All.Antal, [Set 7897-1].[Lego part], [Set 7897-1].farve, [Set 7897-1].Antal, [Parts_All]![Antal]-[Set 7897-1]![Antal] AS Part_Diff
FROM Parts_All RIGHT JOIN [Set 7897-1] ON Parts_All.[Lego part] = [Set 7897-1].[Lego part]
GROUP BY Parts_All.[Lego part], Parts_All.farve, Parts_All.Antal, [Set 7897-1].[Lego part], [Set 7897-1].farve, [Set 7897-1].Antal
HAVING (((Parts_All.[Lego part]) Like [All_parts]![Lego part]) AND ((Parts_All.farve) Like [Set 7897-1]![farve]) AND (([Parts_All]![Antal]-[Set 7897-1]![Antal])>=0));
This query is returning 2 of the same lines with part and colour but with different pcs. Why.?
View 7 Replies
View Related
Nov 22, 2005
Hi, all... welcome back to the new Access World Forums... glad we're still operational, even if some data was lost. It's the minds, anyway, not the data...
I have a query that pulls from 3 transaction tables.
tblTransactions - lists purchaser, amt tendered, other details
tblPurchased_Items - lists products and services paid for
tblTherapy_Treatments - lists treatments paid for
(Note: these are not separate lists of available items. They're two subforms' tables, one that deals with insurance and one that doesn't.)
I can pull this data fine, but in a case where someone had 1 treatment, but purchased 2 products, the query lists the treatment twice. I do have unique IDs for each table's items, but am not sure how to "list" each transaction once, but each thing paid for once, also.
For example:
Joe Blow comes in and has physical therapy and buys 2 books.
My query will show (bogus fields for illustration purposes):
TransactionID Name TherapyID TherapyCost ProductID ProductCost
33 Joe Blow 10 180.00 15 12.00
33 Joe Blow 10 180.00 17 19.00
So, if I total TherapyCost it really gives me twice the correct amount.
Can someone point me to a solution?
Pardon my rank ignorance, yet again.
View 2 Replies
View Related
Apr 14, 2006
Hi,
I need to output data in a specific format for a certain client..
for example where
Select * from Falls - would normally give me:
01/01/05 Joe Smith ICU, Assisted
I need in this intance to get:
01/01/05 Joe Smith 5, 2
where locations, or types etc are converted to a corresponding number.
I can imagine a query like:
Select FallDate, PatientName, somefunction([Location],(MS2,ED,OB,CAFE,ICU),(1,2,3,4,5)), somefunction([Fall_Type],(Accidental,Assisted,Unanticipated),(1,2,3))
Is there some more powerful version of IIF or way to write this in the query without having to create a report with a bunch of functions?
View 5 Replies
View Related
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
Oct 24, 2013
can i set a value in report as parameter in query
View 1 Replies
View Related
May 22, 2015
Im not an Access wiz but have managed to build quiet a few different queries in Access which are from tables linked to the software that holds all our data.Im looking for some way to put all these queries in one please for all my colleagues to VIEW ONLY. I just want some sort of really simple dashboard for the person to pick a report they want from different categories and it will export it to Excel for them.I have thought of building this in Excel because I have some knowledge of VBA in Excel.
View 9 Replies
View Related
Jun 3, 2014
I have a simple report which i open from a navigation form, i have a textbox in the report i wish to use as criteria, on start the report will be blank until i enter a name into the textbox and requery. However im not sure how to link this and how to stop access asking for this information before the report is opened?
View 5 Replies
View Related
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 4 Replies
View Related
Feb 20, 2014
I am making a football database for my sixth form project. It consists of 6 teams and i need to make a top scorers report for each team. I am attempting to make a query for each report which will consist of the fields needed, under the field 'Team Name' i need to validate it for each team so that each query only shows their specific team, then i can make it into a report. But i do NOT know how to validate it. In human words i want it to say something like this " Only include this player if value of the team name if it is equal to 'St.Albans city east' (one of my teams)".
View 1 Replies
View Related
Jul 12, 2014
I have a query that I use to populate a report.
The query has a parameter box that opens and asks the user to enter a date.
I would like to display this date in the Report heading.
Is there any way that I can grab the value entered into the parameter query and display it on my report heading?
View 1 Replies
View Related
Feb 26, 2015
I created a query and one of the fields was "name". In the query it listed the names and then changed to the ID number of the names from the name table. The query was created using the wizard. Why did the query change to the ID number mid report and how do I get it to report only the names and not the ID number.
View 5 Replies
View Related
Oct 14, 2014
I have a combobox that I use to combine the employees first name and id number. So when you pull down the list you can select the employee you want and it is saved in the form. Now I need to create a query so that I can create a report on each employee separately. The query will not let me get the Employee Frist Name/ID from that saved field. I thought that what is saves in that field, you can retrieve it in your queries or reports.
View 3 Replies
View Related
Jul 31, 2013
I am looking to call two different queries from report wizard to produce report. Getting error message what to do in this situation as both queries are important as i have to pick all records from query A and just one record from query B any other option to get this in report.
View 4 Replies
View Related
Mar 12, 2008
I have been running 5 reports to gather company information. I then take the data from these 5 reports and manually load them into an Excel spreadsheet to calculate a grand total. I would like to be able to run a query or report within my database to get the same information. I have attached a copy of my spreadsheet for review.
Could someone please review this spreadsheet and help me design an easier method of calculating a grand total.
View 2 Replies
View Related
Jun 30, 2014
A have a report that is based on a query that works fine when the query returns records.
However if the query (legitimately) returns no records then the report fields (numeric) are blank.
How can i get the query or report to show either "0" or "no data" when no records are returned? I have tried the NZ function but that didn't work so i don't think that is the right approach here?
View 3 Replies
View Related
May 7, 2014
I have a database that has over 20 tables in it and am using Access 2000. Unfortunately I cannot change the structure as it performs specific functions, so I am stuck with it.
I have created a Union Query from these tables yaking data from 5 fields using the Serial Number entered by the user.
SELECT[Workstation].UnitPart,PropertyTag,UnitSerial,Date,Technician
FROM[Workstation]
WHERE((([Workstation].UnitSerial)=[Enter Serial No.];
UNION
SELECT[LAPTOP].UnitPart,PropertyTag,UnitSerial,Date,Technician
[Code] ....
I use a bar code scanner to scan the serial number, and it goes through the tables and returns the results along with the other specified fields.
I would like to scan up to 16 or more different serial numbers and have it return the results. Perhaps scan the first 16 serial numbers, then run the query? Is that possible. The serial numbers are unique and will return a combination of laptops, printers, monitors, etc...
I have created a report from the above union query and it works perfectly with only one serial number entered.
View 14 Replies
View Related
Jun 30, 2015
I am create a database to track leave of my team.I have create the tracker and few reports, however now I want to create a report by applying filters in 2 places, for associate and for leave type or for associate and for joint leave or for associate and for Informed.I have SQL code which does not work. how can I select the other paramater with associate name using combox box in form.
Code:
SELECT Leave_Records.[Absent Date], Leave_Records.[Associate Name], Leave_Records.[Absent Day], Leave_Records.[Leave Availed], Leave_Records.[Joint Leave], Leave_Records.[Informed TL], Leave_Records.[Leave Type], Leave_Records.[Leave Applied], Leave_Records.Comments
FROM Leave_Records
WHERE (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Leave Type])=Forms!Report_Form!Leave_Type)) Or
(((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Joint Leave])=Forms!Report_Form!Joint_Leave)) Or (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Informed TL])=Forms!Report_Form!Informed));
View 1 Replies
View Related
Aug 5, 2014
I am writing a small program for my sons school for there athletics day. We want to register all the students on a data basis. I have a form where you capture all the child's information and then tick box for each event that there will be for the day. So we will only tick the events that the specific child will participate in. I design the table to just import the information from each school from a excel spread sheet directly into the table. What my goal is to print report for each event that will only show the child's names that has register for that specific event and all the different age groups separate. I am stuck at the query and can't seem to get my mind around how to define the query.
View 2 Replies
View Related
Oct 1, 2013
I have a Union Query (that works perfectly fine) with the following code:
Code:
SELECT * FROM sbqryUseBattery
UNION
SELECT * FROM sbqryUseBeltsDeck;
UNION
SELECT * FROM sbqryUseBeltsHydro;
UNION
SELECT * FROM sbqryUseBeltsPTO;
UNION
SELECT * FROM sbqryUseFiltersAir
UNION
SELECT * FROM sbqryUseFiltersFuel
UNION SELECT * FROM sbqryUseFiltersOil;
I am using this information on a Report.
The problem is that the Report shows the data in random order. Is there a way to filter either the Union Query or the Report?
View 14 Replies
View Related
Jul 28, 2015
This is a query, report and vba question. I'm using Ms Access 2007.
TABLE 1: projectname, activityname, totalhoursworked, employeename
TABLE 2: employeename, employeelevel
TABLE 3: employeelevel, rate
I created a select query to join the info that I need.
SELECT QUERY 1: projectname, activityname, employeename, totalhoursworked, rate, cost (calculated field (totalhoursworked*rate))
I have 2 crosstab queries.
CROSSTAB QRY 1: ROW (projectname, activityname) COLUMN (employeename) VALUE (totalhoursworked (summed))
CROSSTAB QRY 2: ROW (projectname, activityname) COLUMN (employeename) VALUE (cost (summed))
I then created a 2nd select query with inner joins to join both crosstab queries on similar fields (activity & projectname).
SELECT QUERY 2: projectname, activityname, employeename (totalhoursworked as value), employeename (calculatedcost as value)
It gives me this:
However, I want it like this:
Those employeename... refers to more employees being added after a period of time. Hence I want to know if I could use vba to generate a report every time a button is pressed on a form? I know how to link the form to the query.
View 8 Replies
View Related
Aug 30, 2013
I have a query that populates a report linked to a mail merge. There is an IFF statement in it that checks to see if a condition is meet. If that condition is meet some standard text results. Is it possible to put a disclaimer with the standard text.For example,
Code:
IIF ([Results]="Negative","Nothing detected" (the disclamer would go here)
I am not certain the correct syntax to use to insert "not all regions were tested".
View 1 Replies
View Related
Aug 18, 2015
I have a query that uses the input from a form as criteria, which is then used in a report. The form input is a drop down based on another table. This is a sales pipeline report, and the list is a list of sales people. The report works perfect for all sales people except one. When I run it for the one, I get the following error:
"This expression is 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".
I DO NOT get the same error when running the query by itself - so assuming there is something in the report causing this. I do have some sum formulas in the report.
Again, no other salespersons selected cause this error -- so I am assuming there is something in the dataset for this person that is causing the error.
View 8 Replies
View Related