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!

Need just disinct records

Status
Not open for further replies.

badger8

MIS
Aug 3, 2001
34
US
Below is the code that I'm using:

SELECT First_Name, Last_Name, City, Postal, First(Do_Not_Solicit), First(Account), First(State), First(Country), First(Email), First(Bad_Email), First(Bad_Email_Host), First(Do_Not_Email)
FROM [marketing lists]
WHERE (((Do_Not_Solicit = no)

and ((Last_Name is not null) and

(Country = 'usa' or Country = 'canada') and

(Title is null or not(Title like '*sales*' or Title like '*marketing*')) and

(Account not like 'univ*') and (Account_Industry is null or not(Account_Industry like 'instrument man*' or Account_Industry = 'university'))))

and ((Email like '*@*') and (Do_Not_Email = no) and (Bad_Email is null)))
GROUP BY First_Name, Last_Name, City, Postal;



But the Do_Not_Solicit and Do_Not_Email field's data type are yes/no. When I run the query, the field value for both of them become 0 and not yes or no. Why?

Could someone give me some advice? Thanks
 
In Access the Yes/No data type (alternately called boolean or logical) is actually stored as 0 for No or False, and -1 (but can be tested for non-zero value) for Yes or True. JHall
 
Hi JHall,

Thanks for the response.

Is there a way that I could have it say yes and no instead of 0 and -1 for within my output?

Ray
 
Certainly, in the control source of your control put something like

=IIF([Do_Not_Email],"Yes","No")

One caveat:

This will only give you output, the control will be bound to the expression and you can't change it without using someother method to change the underlying column value.

I would recommend either using the standard check box or if you want to be more ostentatious an option group with Yes/No radio buttons. JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top