Link to home
Start Free TrialLog in
Avatar of Chris Miller
Chris MillerFlag for United States of America

asked on

Access 2007 Queries

I have a table that lists 100 employees information. One of the fields is a number code, which has many diff codes for some employees. The specific code I want is "001".

I know how to make the query work for just that code, it returns 50 employees.

Here is what I want. A query that will return all employees with the 001 code and the employees that dont have the 001 code.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

<employees that dont have the 001 code. >

here is the query for employees that dont have the 001 code

select *
from TableName
where [code field] <> "001"
Avatar of Chris Miller

ASKER

I need one query that returns employees with the 001 code, which currently is 50 employees. I need the same query to return the other 50 employees that dont have the 001 code.

I have ten codes ( 001-010 ). All employees have atleast one of the ten codes.

My resulting query needs to return all 100 employees but I only need to know about the 001 code.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<<<<<Here is what I want. A query that will return all employees with the 001 code and the employees that dont have the 001 code.>>>>

Wouldn't that be the same as selecting all employees from your table .... sorted by your code field????


ET
Matthew,

Thanks, this is what I needed, just didnt know how to explain it.

SELECT *, IIf([the_code] = "001", "Has 001", "Not 001") AS [Whatever]
FROM [TableName]