If NOT Then This

Microsoft Office access 2007 (upgrade, p...
February 23, 2010 at 08:55:46
Specs: Windows Vista
I need help building a query. Our clients almost always have one sales rep attached to them but sometimes they have a second as well. My question is how would I build a query that allows me to pull a single sales reps clients? How do I get a query to pull both columns (Primary Rep and 2nd Rep) that have the same name without pulling up a blank list.
If I select John Smith as the criteria for the first column and then specify the criteria for the second column as the same (John Smith) then the query is blank. How do I get the query to ignore the first column if it doesn't have what I want so it will then pull the same name in the second one.
Hope this makes sense.

See More: If NOT Then This

Report •


#1
February 26, 2010 at 22:25:09
sounds like you are using AND instead of OR

Select * FROM Table WHERE FirstColumd = John Smith OR Second Column = "John Smith"

Stuart


Report •

#2
March 1, 2010 at 06:43:16
That makes sense but *how* do I make two columns use OR instead of AND?

Report •

#3
March 1, 2010 at 10:48:00
What are you using to query the database?

My last post is an SQL query to to pull records where John Smith is in one column or the other. You will have to adjust the punctuation a bit to make it work.

Stuart


Report •

Related Solutions


Ask Question