On 12/1/00, W Luke penned:
>Instead of returning 2 records, which it should have, it returned 22 (and
>incidentally email all 22!) Here's the query:
>
><Cfquery name="invoices" datasource="localads">
>SELECT
>advert_details.body,advert_details.subject,advert_details.end_date,advert_de
>tails.start_date,advert_details.ID,advert_details.email,ad_ID,advert_ID,paym
>ents.paid,sent FROM payments,invoices,advert_details
>WHERE payments.paid = Yes AND invoices.sent = No AND payments.ad_ID =
>advert_ID
></cfquery>
>
>What am I missing? I think it's pulling all adverts from advert_details
>which match an email address in payments or invoices.
You'll need to add 1 more join since you are using 3 tables in your
From clause. You have payments joined to advert_details. Now you need
to join invoices to payments will probably do the trick.
--
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists