Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / October 2006

Tip: Looking for answers? Try searching our database.

Supress Record in QUERY

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Warren Phillips - 17 Oct 2006 21:18 GMT
Hi:

I am looking for a way to do the following.  I have a QUERY with data that
looks like the following:

Employee      Salary      Reimbursement      Code
1229              500.00          
1229                                    50.00               NT

For this employee (#1229), I want to ONLY keep the record that contains
(CODE = NT). The other record (Salary of 500.00) can drop out of the QUERY.

The key here is that I have a list of Employee numbers that will fall into
this logic....ie

If Employee Number = X
AND
Code = NT

Display the record in the QUERY.

If Employee Number = X
AND
Code <> NT
Then....."Supress" the record from showing in the QUERY

Any ideas

Thanks

Warren Phillips

 

If any record has NT in the adjustment code field...I want to keep it in the
QUERY.....If
kingston - 17 Oct 2006 21:45 GMT
Is there a reason you cannot add the criteria "NT" to the field Code in the
query?  I must not be understanding your problem correctly.

>Hi:
>
[quoted text clipped - 32 lines]
>If any record has NT in the adjustment code field...I want to keep it in the
>QUERY.....If
Warren Phillips - 17 Oct 2006 22:43 GMT
Yes....it is becuase there are all kinds of other records that need to be
displayed.....Of the records that have "NT" in the CODE field (and only for a
certain subset of Employee numbers)....I need the logic describerd below to
kick in....Thanks

> Is there a reason you cannot add the criteria "NT" to the field Code in the
> query?  I must not be understanding your problem correctly.
[quoted text clipped - 35 lines]
> >If any record has NT in the adjustment code field...I want to keep it in the
> >QUERY.....If
John Spencer - 18 Oct 2006 12:55 GMT
IF the list is short you could use

WHERE (Employee In (1229,1258,3999) and Code = "NT") OR Employee Not In
(1229,1258,3999)

If the list is long and you have it in a table then you could use logic like

WHERE (Employee in (SELECT ID From TableHideThese) AND Code = "NT")  OR
              Employee In (SELECT T.ID
                                  FROM MainTable LEFT JOIN TableHideThese
as T
                                  ON MainTable.Employee = T.Employee
                                  WHERE T.Employee is Null)

> Yes....it is becuase there are all kinds of other records that need to be
> displayed.....Of the records that have "NT" in the CODE field (and only
[quoted text clipped - 45 lines]
>> >the
>> >QUERY.....If
Warren Phillips - 18 Oct 2006 14:30 GMT
John:

Thank you

It is a short list.....where would I put this CODE within the QUERY to get
it to work????

WHERE (Employee In (1229,1258,3999) and Code = "NT") OR Employee Not In
(1229,1258,3999)

> IF the list is short you could use
>
[quoted text clipped - 59 lines]
> >> >the
> >> >QUERY.....If
John Spencer - 18 Oct 2006 15:36 GMT
Assuming you are using the query grid

Field: Employee
Criteria (Line 1):  In (1229,1258,3999)
Criteria (Line 2): Not In (1229,1258,3999)

Field: Code
Criteria (Line 1):  "NT"
Criteria (Line 2):  <<Leave this blank>>

> John:
>
[quoted text clipped - 76 lines]
>> >> >the
>> >> >QUERY.....If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.