Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need help composing a SQL statement

Posted on 2012-03-21
7
Medium Priority
?
245 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 70

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 70

Expert Comment

by:Scott Pletcher
ID: 37748024
Nope, still nothing.  Maybe it's my version of Excel (2010)?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public 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 70

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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