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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query excluding unwanted emails

Status
Not open for further replies.

Jimmy2128

Programmer
Feb 6, 2003
58
US
Dear Sir,
I have the following statement that put a Member Roster, Currently prints everyone has email listed, but I need to exclude all the member that check the NO_EMAIL check box.
How can I write and IIF statement that exclude the unwanted email...

Thanks



AS BADGE_ADDR_EMAIL_PHONE_FAX,
IIf(dbo_Order_Badge.TITLE<>'',dbo_Name.TITLE & Chr(13) & Chr(10),'')
& IIf(dbo_Order_Badge.COMPANY<>'',dbo_Order_Badge.COMPANY & Chr(13) & Chr(10),'')
& IIf(dbo_Order_Badge.COUNTRY<>'',dbo_Order_Badge.COUNTRY & Chr(13) & Chr(10),'')
& IIf(dbo_Name.WORK_PHONE<>'',dbo_Name.WORK_PHONE & Chr(13) & Chr(10),'')
& IIf(dbo_Name.EMAIL<>'',dbo_Name.EMAIL & Chr(13) & Chr(10),'')
& IIf(dbo_Name.CHAPTER<>'',dbo_Name.CHAPTER & ' / ' & qChapters.TITLE,'') AS BADGE_ADDR_EMAIL_PHONE_NOFAX, dbo_Orders.STATUS
 
Don't use iif, use a WHERE clause to select only those with the box unchecked
Code:
Where ...NO_EMAIL=False...

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top