Chris Miller
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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<<<<<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
Wouldn't that be the same as selecting all employees from your table .... sorted by your code field????
ET
ASKER
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]
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]
here is the query for employees that dont have the 001 code
select *
from TableName
where [code field] <> "001"