In the following query I want the email addresses from two different tables
to be grouped together (for sending in CFMail), can't get it to work, what
am I missing? (BTW: the individual queries work just not as a UNION)

<cfquery name="qMailMessage" datasource="#REQUEST.dsnSQL#"
username="#REQUEST.dsnUID#" password="#REQUEST.dsnPWD#">
SELECT L.email, L.firstname, L.lastname
FROM #REQUEST.prefix#_Members_List L
WHERE L.email IS NOT NULL

UNION

SELECT A.assistantfirstname, A.assistantLastName,
A.assistantEmail AS A.email
FROM #REQUEST.prefix#_Members_AssistantInfo A
WHERE A.email IS NOT NULL

ORDER BY email
</cfquery>

Thanks, Mark
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to