Note that there are some explanatory texts on larger screens.

plurals
  1. POMS ACCESS query
    text
    copied!<p>This query is not working because of two columns in the Where condition (<code>tblEventLog.PartNumberChgLvl</code>). How should I change the query to work it out?</p> <pre><code>strNewSql1 = _ "SELECT DISTINCT " &amp; _ "tblRevRelLog_Detail.PartNumber, " &amp; _ "tblRevRelLog_Detail.ChangeLevel " &amp; _ "FROM tblRevRelLog_Detail LEFT JOIN tblEventLog " &amp; _ "ON (tblEventLog.PartNumber = tblRevRelLog_Detail.PartNumber) " &amp; _ "AND (tblEventLog.PartNumberChgLvl " &amp; _ "= tblRevRelLog_Detail.ChangeLevel) " &amp; _ "WHERE (tblEventLog.PartNumber, tblEventLog.PartNumberChgLvl) NOT IN " &amp; _ "(SELECT tblEventLog.PartNumber, tblEventLog.PartNumberChgLvl " &amp; _ "FROM tblEventLog " &amp; _ "WHERE tblEventLog.EventTypeSelected = 'pn REMOVED From Wrapper' " &amp; _ "AND tblEventLog.PartNumber = tblRevRelLog_Detail.PartNumber " &amp; _ "AND tblEventLog.PartNumberChgLvl " &amp; _ "= tblRevRelLog_Detail.ChangeLevel) " &amp; _ "AND tblEventLog.TrackingNumber = """ &amp; tempTrackingNumber &amp; """ " &amp; _ "AND tblEventLog.PartNumber = tblRevRelLog_Detail.PartNumber " &amp; _ "AND tblEventLog.PartNumberChgLvl = tblRevRelLog_Detail.ChangeLevel;" </code></pre> <p>I am showing this by using an example.</p> <p><strong>example: lets take two packages 1 and 2</strong></p> <p>package 1 has a-1, b-0, c-1 Partnumber with changelevels and package 2 has a-1, d-1, e-1 Partnumber with changelevels</p> <p>if I remove "a-1" from the package 1, that should no show up with that package but it should show up with package 2. With this query it is not showing up in the package 2 also.</p> <p>Reviewrelease_Form(main form) linked to reviewreleasetable:</p> <p>this table contains basic data and wrapper number </p> <p>wrapper number: RevRel_Form(subform) linked to tblRevRelLog_Detail</p> <p><strong>event_Input is the subform where we enter events. When I select an event It will display the partnumbers. This is where the query comes into picture.</strong></p> <p>This should not display removed partnumbers. That is working fine. But if the same part number with same changelevl is removed from diff package..it is also not showing up in the current package.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload