Getting syntex error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Getting syntex error

SELECT PT.PostedDate ‘dtPosted’, <font color="red"><img src=’sClsTrxStatus = PTS.Name ‘sName’ ‘ border=’0’ /> </font id="red"> , <br /> <br />FROM Joinig PT<br />INNER JOIN Posting PTS ON PT.StatusId = PTS.StatusId<br /><br />i am getting syntex error while running the query<br /><br />Regards <br />Sudipta K. Ghosh<br />
what is sClsTrxStatus —————————————-
Contributing Editor, Writer & Forums Moderator
http://www.SQL-Server-Performance.Com Visit my Blog at
http://dineshasanka.spaces.live.com/

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by sudiptakr</i><br /><br />SELECT PT.PostedDate ‘dtPosted’, <font color="red"><img src=’sClsTrxStatus = PTS.Name ‘sName’ ‘ border=’0’ /> </font id="red"><font color="red"><font size="4"> <font size="6">,</font id="size6"> </font id="size4"> </font id="red"> <br /> <br />FROM Joinig PT<br />INNER JOIN Posting PTS ON PT.StatusId = PTS.StatusId<br /><br />i am getting syntex error while running the query<br /><br />Regards <br />Sudipta K. Ghosh<br /><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />One comma(just before From clause) is extra there. it seems that the table name also wrong (Joinig may be Joining)<br />Madhu
sorry ‘,’ was not there.
my problem is hoe do i print the column name as "sName"? SELECT PT.PostedDate ‘dtPosted’, sClsTrxStatus = PTS.Name ‘sName’ FROM Joinig PT
INNER JOIN Posting PTS ON PT.StatusId = PTS.StatusId Regards
Sudipta K. Ghosh

declare @sClsTrxStatus varchar(255)
SELECT PT.PostedDate ‘dtPosted’, @sClsTrxStatus = PTS.Name ‘sName’
print @sClsTrxStatus
—————————————-
Contributing Editor, Writer & Forums Moderator
http://www.SQL-Server-Performance.Com Visit my Blog at
http://dineshasanka.spaces.live.com/

u may need this SELECT PT.PostedDate As ‘dtPosted’, PTS.Name As ‘sName’ FROM Joinig PT
INNER JOIN Posting PTS ON PT.StatusId = PTS.StatusId Madhu
]]>