Solved

Need help composing a SQL statement

Posted on 2012-03-21
7
238 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
  • 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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 500 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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