R
rbchildrn
Hello. I have a table that includes a yes/no column for whether or not
we send mail to each record. I need to run a query that doesn't show
those who have the box unchecked. I can't find an answer for this
seemingly simple problem in the posts.
I have verified that all records in the table have a value in the
yes/no (check box) field, and the query returns all records whether my
criteria is True, -1, or Not False. It seems like it should work, it
just doesn't.
Let me know what other info you need. I do have other criteria for
other fields in the query - could they be interfering somehow?
Here is the SQL:
SELECT Trim(TblPeople.NamePrefix & " " & TblPeople.FirstName & " " &
TblPeople.MiddleInitial & " " & TblPeople.LastName & " " &
TblPeople.NameSuffix & " " & (IIf(TblPeople.[Family Address?]=True,"and
Family",Null))) AS PrintName, TblPeople.Address1, TblPeople.Address2,
TblPeople.City, TblPeople.State, TblPeople.Zip
FROM TblPeople INNER JOIN [QryDonation Totals Ind] ON TblPeople.Id =
[QryDonation Totals Ind].Id
WHERE (((TblPeople.City)=NZ([Forms]![Create Data Source for
Mailings].[Text2],[TblPeople].[City])) AND (([QryDonation Totals
Ind].SumOfDonationAmount)>=NZ([Forms]![Create Data Source for
Mailings].[Text0],0)) AND ((TblPeople.[Addressee?])=True) AND
((TblPeople.MembershipStatus)="Active") AND
((TblPeople.[Adult?])=True)) OR ((([QryDonation Totals
Ind].SumOfDonationAmount) Is Null));
The first part adds some fields together so that I can match fields for
a Union Query with Organization mailing info. There is also
referenced a query that totals donation amounts per person. In the
WHERE statement I am referencing text boxes on forms where the user can
enter minimum donation total or City.
FYI: The MembershipStatus field is also returning all results, not
just "Active". However, the "Family Address?" function I have in
there works great, as do the City and Donation filters.
we send mail to each record. I need to run a query that doesn't show
those who have the box unchecked. I can't find an answer for this
seemingly simple problem in the posts.
I have verified that all records in the table have a value in the
yes/no (check box) field, and the query returns all records whether my
criteria is True, -1, or Not False. It seems like it should work, it
just doesn't.
Let me know what other info you need. I do have other criteria for
other fields in the query - could they be interfering somehow?
Here is the SQL:
SELECT Trim(TblPeople.NamePrefix & " " & TblPeople.FirstName & " " &
TblPeople.MiddleInitial & " " & TblPeople.LastName & " " &
TblPeople.NameSuffix & " " & (IIf(TblPeople.[Family Address?]=True,"and
Family",Null))) AS PrintName, TblPeople.Address1, TblPeople.Address2,
TblPeople.City, TblPeople.State, TblPeople.Zip
FROM TblPeople INNER JOIN [QryDonation Totals Ind] ON TblPeople.Id =
[QryDonation Totals Ind].Id
WHERE (((TblPeople.City)=NZ([Forms]![Create Data Source for
Mailings].[Text2],[TblPeople].[City])) AND (([QryDonation Totals
Ind].SumOfDonationAmount)>=NZ([Forms]![Create Data Source for
Mailings].[Text0],0)) AND ((TblPeople.[Addressee?])=True) AND
((TblPeople.MembershipStatus)="Active") AND
((TblPeople.[Adult?])=True)) OR ((([QryDonation Totals
Ind].SumOfDonationAmount) Is Null));
The first part adds some fields together so that I can match fields for
a Union Query with Organization mailing info. There is also
referenced a query that totals donation amounts per person. In the
WHERE statement I am referencing text boxes on forms where the user can
enter minimum donation total or City.
FYI: The MembershipStatus field is also returning all results, not
just "Active". However, the "Family Address?" function I have in
there works great, as do the City and Donation filters.