View Single Post
  #6  
Old September 27th, 2004, 09:10 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Mon, 27 Sep 2004 11:24:13 -0700,
wrote:

All I want to do is pick up Sales of items that are not in
the list. The same query works with "in" but gives
me "data type mismatch in criteria expression". What do I
do?

SELECT Sum([Sales temp].Sales) AS Sales
FROM [Sales temp]
WHERE ([Sales temp]![item] Not in ("25773621","afy04890"));


Two questions:

- Does it work if you change the ! to . in the WHERE clause?
- Is [item] a Lookup field? If so, it does not actually contain the
text which it appears to contain. The Lookup Wizard (annoyingly)
conceals the actual contents of the table - a numeric ID; but that's
what you need to use in the query.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps