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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 *Basic Query* Incorrect Syntax Near '-'

Author  Topic 

phillipsdj
Starting Member

2 Posts

Posted - 2011-11-01 : 05:33:28
Hi all,

I am a very basic SQL user, with no real ability to write queries at all.

I have been given the below script which to my untrained eye looks like it should work but I am getting an 'Incorrect Syntax near '-' error regarding the final line.

Sorry to ask such a basic question but could somebody please take a look and let me know what mistake I have made?

select
a.NAME
,p.EVENTID
,ae.RATE
,p.PERSPCODE
,p.PERSPVALUE
,p.STDDEVI
,p.STDDEVC
,p.EXPVALUE

from
rdm_port p
inner join rdm_anlsevent ae on p.ANLSID = ae.ANLSID and p.EVENTID = ae.EVENTID
inner join rdm_analysis a on p.ANLSID = a.ID

where
p.PERSPCODE = 'RL' –- or 'RN’ for treaty

Many thanks,

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-11-01 : 05:37:43
you don't have 2 dash in the last line. One of them is not a dash. remove it and re-key


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

phillipsdj
Starting Member

2 Posts

Posted - 2011-11-01 : 05:39:59
Thank you very much for the quick reply. I am sorry to have wasted your time with such a minor error!....
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-11-01 : 05:52:02
you are welcome


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -