Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
boc2
Starting Member
2 Posts |
Posted - 2012-05-31 : 17:36:47
|
| Please help, when I enter thisSELECT Assignment.StartDate, Assignment.EndDate, Park.Name FROM Assignment WHERE Assignment.EndDate >= Convert(datetime, Convert(int, GetDate()))INNER JOIN Park ON Park.ParkID=Assignment.ParkID";I get a error "Incorrect syntax near the keyword 'INNER'"Annie Boc2 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2012-05-31 : 17:39:38
|
| Your query make little to no sense. Can you explain in words what you are trying to do? Also, maybe these links will help:http://www.sqlservercentral.com/articles/Best+Practices/61537/http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
boc2
Starting Member
2 Posts |
Posted - 2012-05-31 : 17:46:05
|
| I have two table Assignment (startdate ,enddate , parkid) , park (parkid,name) I want to pull only the park's name where the project end date has not passed the current date. Asp.net is still showing me the error "Incorrect syntax near the keyword 'INNER'".tkizer, I tried to switch the where statement but it still did not work.Annie Boc2 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2012-05-31 : 18:09:46
|
I'm not sure aboutquote: I want to pull only the park's name where the project end date has not passed the current date.
But, maybe this will work.... SELECT Assignment.StartDate, Assignment.EndDate, Park.Name FROM AssignmentINNER JOIN Park ON Park.ParkID = Assignment.ParkIDWHERE Assignment.EndDate <= CAST(SYSDATETIME() AS DATE) |
 |
|
|
|
|
|
|
|