Link to home
Start Free TrialLog in
Avatar of Michael Robinson
Michael RobinsonFlag for United States of America

asked on

Need help writing ColdFusion sql query with a JOIN

Queries that use a join always baffle me so I could use some expert advice. Thanks in advance...

How to I write a ColdFusion query where:

I have one database called "Visitors"

I have 2 tables in that database:
"Users" is a table with my entire membership listing
"EmailSent" is a table listing every newsletter sent to each member

The common field is "UserID"

Within EmailSent is a field called "TemplateUsed" which is a different template for each version of the newsletter.

I need a query that will output the UserID's of those members who did not yet receive a particular template called "ImportedCareerCoach5.cfm"

But they may have received other newsletters.

Hope that makes sense.

 I'm running CF 10 and MS SQL
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Robinson

ASKER

Thank you GDEMARIA, that worked.

Sorry for such a late reply.  I started working with your solution right away, but was getting odd results, which took a lot of analysis.  
but it's working now in production.

Thank you Ryan Chong.  Sorry I did not get to try your solution, but I will use it next time to see how it works.

Thanks to all of you
Michael