473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Too much info showing in a report need to better define query...help!?!

I have a database that tracks the withdrawls and returns of shared assets.
I have a query that a report runs off of that is supposed to only show the most current withdrawl (based off of a yes/no check box in the order form and return forms). However, the report shows every time the item has ever been removed, any time the check box has been checked.

I think that if I set it so that if the return date is less than the order date, show the info.

Would this work? And if so how would I write that in the design veiw of a query in MS Acess for 2000 professional?
Jan 11 '08 #1
5 1358
zaidlig
45
I have a database that tracks the withdrawls and returns of shared assets.
I have a query that a report runs off of that is supposed to only show the most current withdrawl (based off of a yes/no check box in the order form and return forms). However, the report shows every time the item has ever been removed, any time the check box has been checked.

I think that if I set it so that if the return date is less than the order date, show the info.

Would this work? And if so how would I write that in the design veiw of a query in MS Acess for 2000 professional?
It would help if you provide the SQL from your current query. Essentially you want to use the group by function where the query will look at a group of records to select and report a single record based on the date order and any criteria you add.
Jan 11 '08 #2
It would help if you provide the SQL from your current query. Essentially you want to use the group by function where the query will look at a group of records to select and report a single record based on the date order and any criteria you add.

The SQL in my current query is:
SELECT tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.OrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number
FROM ((tblEmployee INNER JOIN tblOrder ON tblEmployee.GlobalID = tblOrder.GID) INNER JOIN tblReturn ON tblEmployee.GlobalID = tblReturn.GID) INNER JOIN ((tblItemSpecifics INNER JOIN tblOrderInfo ON tblItemSpecifics.Serial_Number = tblOrderInfo.Serial_Number) INNER JOIN tblReturnInfo ON tblItemSpecifics.Serial_Number = tblReturnInfo.Serial_Number) ON (tblReturn.ReturnNumber = tblReturnInfo.Return_Number) AND (tblOrder.OrderNumber = tblOrderInfo.Order_Number)
GROUP BY tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.OrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number, tblItemSpecifics.Removed
HAVING (((tblItemSpecifics.Removed)=True));

I don't know how to read SQL (yet, working on it). So I'm not sure if this will help.
Jan 11 '08 #3
zaidlig
45
The SQL in my current query is:
SELECT tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.OrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number
FROM ((tblEmployee INNER JOIN tblOrder ON tblEmployee.GlobalID = tblOrder.GID) INNER JOIN tblReturn ON tblEmployee.GlobalID = tblReturn.GID) INNER JOIN ((tblItemSpecifics INNER JOIN tblOrderInfo ON tblItemSpecifics.Serial_Number = tblOrderInfo.Serial_Number) INNER JOIN tblReturnInfo ON tblItemSpecifics.Serial_Number = tblReturnInfo.Serial_Number) ON (tblReturn.ReturnNumber = tblReturnInfo.Return_Number) AND (tblOrder.OrderNumber = tblOrderInfo.Order_Number)
GROUP BY tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.OrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number, tblItemSpecifics.Removed
HAVING (((tblItemSpecifics.Removed)=True));

I don't know how to read SQL (yet, working on it). So I'm not sure if this will help.
I see you are already using Group By. So at the field that contains the withdrawl date change it from Group By to Max. And that should give you the last date the item was checked instead of the all the checked dates.
Jan 11 '08 #4
I see you are already using Group By. So at the field that contains the withdrawl date change it from Group By to Max. And that should give you the last date the item was checked instead of the all the checked dates.

Your solution worked! Thanks a bunch!
Jan 14 '08 #5
Same problem, different twist.

In the database each person who can remove a tool has a unique ID number. My earlier issue that showed every time an item was removed has been fixed if it is only one person who has ever removed the item.

Now if I take the item out and then someone else takes the item out after I bring it back, it shows the last time I took it out and the last time anyone else took it out.
This is the code:
Expand|Select|Wrap|Line Numbers
  1. SELECT tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, Max(tblOrder.OrderDate) AS MaxOfOrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number
  2. FROM (tblEmployee INNER JOIN tblOrder ON tblEmployee.GlobalID = tblOrder.GID) INNER JOIN (tblItemSpecifics INNER JOIN tblOrderInfo ON tblItemSpecifics.Serial_Number = tblOrderInfo.Serial_Number) ON tblOrder.OrderNumber = tblOrderInfo.Order_Number
  3. GROUP BY tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number, tblItemSpecifics.Removed
  4. HAVING (((tblItemSpecifics.Removed)=True));
Jan 18 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at...
2
by: Hohn Upshew | last post by:
I need some help to build a report enumerating the products in descending order depending on the sum of liters. In this way i can view the top products sold for a given period.But i fail to do...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
3
by: RC | last post by:
I can't quite grasp the concept of creating custom reports depending upon what options a user picks on a Form. For example, the user clicks on a "Print Reports" button and a Form pops up. On the...
4
by: Alex | last post by:
I have searched the boards but I have not found what I am looking for yet. I have a form with two combo boxes. When the user makes a selection in both of the combo boxes the information will...
5
by: Tony Williams | last post by:
I have a table "tblmaintabs" that stores data that is collected from various companies on a quarterly basis in March, June, September and December each year (these dates are stored in a Date/time...
2
by: amith.srinivas | last post by:
Hi all, From a word macro in VBA, I am trying to create a report in access DB. The report is based on a query with a parameter. I am using Set rpt = Application.CreateReport rpt.RecordSource =...
11
by: radink | last post by:
Hey All, I have a report that I would like to show a word on based on if a field is checked in a form. For example. The form has a check box called Fee. If that is checked, I want the word Paid...
10
by: Christina123 | last post by:
I have a report that runs off of a query. The report is supposed to show the items that are currently withdrawn. I had an issue with it showing every time an item had been withdrawn, even though it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.