S
Stephanie
Hello. I've made a minor change to my db and now I can't figure out how to
make a change to sql.
I'm now allowing for 2 email addresses. I'm using EmailFlag which tells me
if I'm to use EmailName1 or EmailName2. Before I just had EmailName.
I was able to fix the "straight" sql:
SELECT IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]) AS
EmailName, Chapter.ChapterName
FROM Chapter INNER JOIN (Contacts INNER JOIN ChapterMembers ON
Contacts.ContactID = ChapterMembers.ContactID) ON Chapter.ChapterID =
ChapterMembers.ChapterID
WHERE (((IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]))
Is Not Null) AND
((Chapter.ChapterName)=[Forms]![ChapterParamEmail]![FindChapter]));
This works just fine. But, I also have code that uses the same idea as
above. Unfortunately, I can't figure out how to handle
IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]) AS
EmailName
embedded in the code.
Here's the "old" code:
"SELECT Contacts.EmailName FROM ChapterMembers INNER JOIN " + "Contacts ON
ChapterMembers.ContactID = Contacts.ContactID " + "WHERE
(((ChapterMembers.ChapterID)=" + CStr(Me.FindChapter) + ") AND
((Contacts.EmailName) Is Not Null));"
I'd appreciate your help. Thanks!
make a change to sql.
I'm now allowing for 2 email addresses. I'm using EmailFlag which tells me
if I'm to use EmailName1 or EmailName2. Before I just had EmailName.
I was able to fix the "straight" sql:
SELECT IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]) AS
EmailName, Chapter.ChapterName
FROM Chapter INNER JOIN (Contacts INNER JOIN ChapterMembers ON
Contacts.ContactID = ChapterMembers.ContactID) ON Chapter.ChapterID =
ChapterMembers.ChapterID
WHERE (((IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]))
Is Not Null) AND
((Chapter.ChapterName)=[Forms]![ChapterParamEmail]![FindChapter]));
This works just fine. But, I also have code that uses the same idea as
above. Unfortunately, I can't figure out how to handle
IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2]) AS
EmailName
embedded in the code.
Here's the "old" code:
"SELECT Contacts.EmailName FROM ChapterMembers INNER JOIN " + "Contacts ON
ChapterMembers.ContactID = Contacts.ContactID " + "WHERE
(((ChapterMembers.ChapterID)=" + CStr(Me.FindChapter) + ") AND
((Contacts.EmailName) Is Not Null));"
I'd appreciate your help. Thanks!