?
Solved

Need help composing a SQL statement

Posted on 2012-03-21
7
Medium Priority
?
242 Views
Last Modified: 2012-03-26
Have a look at my attached xls file.  It provides the tables I'm referring to and the two sets of results (scroll right to see them) I'm looking to return.

I need both statement to return values based on the EventID and the number of Leads based on that EventID.

I'm really hoping someone can help me because I don't even know where to being.  It is just too advanced for me.  

Could someone please look at my problem and post the T-SQL statement that would return my desired result?  Thanks You.  I'm truly stumped.
Report-Help.xls
0
Comment
Question by:cdemott33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 37747886
I'm not seeing anything in the attachment.
0
 

Author Comment

by:cdemott33
ID: 37747984
Let me try again.
Report-Help.xls
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 37748024
Nope, still nothing.  Maybe it's my version of Excel (2010)?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:cdemott33
ID: 37748084
Very odd.  I'm saving it as an Excel 97-2003 file so it should open up in 2010 without issue.  Let me try something different.  Please stand by.
0
 

Author Comment

by:cdemott33
ID: 37748128
I convert it into a PDF file.  You'll have to zoom in to see it but hopefully you can open this up and see the data.
Report-Help.pdf
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 37748208
OK, I can see it.
0
 
LVL 39

Accepted Solution

by:
appari earned 2000 total points
ID: 37750777
try this
Select 
 A.AnswerOption, count(L.LeadID)
From Answers A Join Question Q
on A.QuestionID = Q.QuestionID
Left Outer Join QuestionnaireResults QR
on QR.QuestionID = Q.QuestionID 
and A.AnswerID = QR.AnswerID
Left outer join Leads L
on QR.LeadID = L.LeadID
where L.EventID=1
Group by A.AnswerOption

Open in new window

0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question