Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this be done in a Query or Filter?

Status
Not open for further replies.

ErikNilsson

IS-IT--Management
Apr 6, 2001
2
0
0
US
I have multiple tables linked into a Query. This is used to build a Report with Account #'s and other personal information.

What Im trying to accomplish is when the Account# = Pending and the Rep name is null I want to exclude these from the report. But when the Account# is a real account number I want to show these even if they don't have a rep name associated with them.

Any help would be much appreciated.

Erik
 
WHERE NOT (acctNum = 'pending') AND NOT isNull(repName)

That should be the WHERE clause in your statement -- assuming that acctNum is a string field --
 
Well I tried this and it gives me an error. "At most one record could be returned by this sub Query"

(SELECT [AccountNum] FROM [OrdersText]WHERE NOT (AccountNum = 'pending') AND NOT isNull(Rep))

That is my statement Im not that great with writing these so if anyone sees something wrong with this let me know :)

Erik Nilsson
 
Just did a mock-up

SELECT [AccountNum] From [OrdersText] WHERE ([Account#] = 'Pending') AND ([Rep] IS NOT NULL);

Worked just fine. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top