Thank you John,
I must have been too close to the forest to see the trees. My next question is how to count the processed inventory for the week given that in order to be considered as processed, the inquiry cannot have an open quality segment. Would I use a WHERE clause with the following:
WHERE (((tblTrackingSegments.Action_Type) In ("VAL","QLT","QLR","REW","COR")) AND ((tblTrackingSegments.Completion_Date) Is Not Null And (tblTrackingSegments.Completion_Date) Between DateAdd("ww",-1,DateAdd("d",-Weekday(Date(),7)+1,Date())) And DateAdd("d",-Weekday(Date(),7),Date())) AND ((tblAssignmentSegments.Assignee_End_Code) In ("C","D","N")))
Darrell
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Tuesday, February 05, 2013 2:20 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] Count Open Inventory
Darrell-
At first, I was wondering why you didn't just post the SQL in your message,
but the picture on the Design grid helps see the bigger picture.
You need to remove tblTrackingSegments and tblAssignmentSegments from your
query and add an IN clause.
WHERE Volume_SeqNo IN (SELECT Volume_SeqNo FROM tblAssignmentSegments LEFT
JOIN tblTrackingSegments ON ... WHERE ...)
In the Subquery, select rows that have an open quality review (and any other
criteria that you need). As long as one row qualifies, your record from
tblVolumeSegments will be included.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of D
Sent: Tuesday, February 05, 2013 3:08 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Count Open Inventory
Greetings All,
I am using Access 2007 SP 2 on Win 7 Enterprise.
I have a database that tracks the workflow for inquiries. There is a query
that tracks the weekly processing providing the beginning inventory,
quantity received, quantity processed, and the ending inventory. There is
also a quality reveiw element to the database. A manager has decided that if
an inquiry has been closed by the analyst but has an open quality review,
the inquiry should still count as an open inventory item.
My problem is that it is possible for an inquiry to have multiple quality
reviews. My question is how do I count an inquiry only once as either
processed or open if there are multiple quality segments attached to the
inquiry?
I will post the SQL for my current query that gathers the data to the Needs
Assistance folder.
Darrell
------------------------------------
Yahoo! Groups Links
The information contained in this communication is highly confidential and is intended solely for the use of the individual(s) to whom this communication is directed. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information is prohibited. Please notify the sender, by electronic mail or telephone, of any unintended receipt and delete the original message without making any copies.
Blue Cross Blue Shield of Michigan and Blue Care Network of Michigan are nonprofit corporations and independent licensees of the Blue Cross and Blue Shield Association.
[Non-text portions of this message have been removed]
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar