Hi im running the below query but its picking up the email address 8 times, even tho the INVOICE_Key and the name of the actual Invoice only occurs once in the table
any ideas?
<cfquery name="Getemails" datasource="#TEST#">
SELECT CU.CUSTOMER_Email,C.COMPANY_Email
FROM Customer CU, Company C, Invoice I
Where I.COMPANY_Number = C.Company_Number
AND I.CUSTOMER_AccNum = CU.CUSTOMER_AccNum
AND I.CUSTOMER_DelvNum = CU.CUSTOMER_DelvNum
AND I.Invoice_Key IN (#form.INVOICE_Checktosendemail#)
</cfquery>
on the previous screen (dsp_search.cfm) I have a list box where you select the company you wish to use known as COMPANY_Number
from there I want it to pass it onto the Action page Act_Send.cfm) so it remembers it in this query below
<cfquery name="Getemails" datasource="#TEST#">
SELECT CU.CUSTOMER_Email,C.COMPANY_Email
FROM Customer CU, Company C, Invoice I
Where I.COMPANY_Number = C.Company_Number
AND I.CUSTOMER_AccNum = CU.CUSTOMER_AccNum
AND I.CUSTOMER_DelvNum = CU.CUSTOMER_DelvNum
AND I.Invoice_Key IN (#form.INVOICE_Checktosendemail#)
</cfquery>