[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SQL statement won't let add a WHERE. Get an error: Incorrect Syntax Near the Keyword WHERE

Posted on 2012-04-05
5
Medium Priority
?
427 Views
Last Modified: 2012-06-27
SELECT MONTH(start) AS 'Month', location, ID, Event,[Start], [End]
FROM dbo.vw_Events Group By Month(start), location, ID, Event, [Start],[End]
ORDER BY [Start] ASC

When ever I try to add a WHERE, I get an error.

Thanks in advance Experts.
0
Comment
Question by:colonelblue
[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
5 Comments
 
LVL 3

Assisted Solution

by:tobyweston
tobyweston earned 1000 total points
ID: 37813289
Where are you putting the "Where" part of the statement?
0
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 1000 total points
ID: 37813293
The after the from

SELECT MONTH(start) AS 'Month', location, ID, Event,[Start], [End]
FROM dbo.vw_Events
where ID in (1,2,3)
Group By Month(start), location, ID, Event, [Start],[End]
ORDER BY [Start] ASC
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 37815855
what is the code of vw_Events?
0
 
LVL 32

Expert Comment

by:awking00
ID: 37816313
What does the statment that gives you the error look like?
0
 

Author Closing Comment

by:colonelblue
ID: 37816555
Thank you Experts.<br />I was putting the WHERE after the group and not before as tobyweston and ged325<br />pointed put.<br /><br />You guys rock!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

649 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