[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

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

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
colonelblue
Asked:
colonelblue
2 Solutions
 
tobywestonCommented:
Where are you putting the "Where" part of the statement?
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
what is the code of vw_Events?
0
 
awking00Commented:
What does the statment that gives you the error look like?
0
 
colonelblueAuthor Commented:
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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now