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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Expected lexical element not found: <identifier>

Author  Topic 

dprichard
Yak Posting Veteran

94 Posts

Posted - 2009-03-30 : 10:09:12
I am stumped. I am trying to do a sub query, but am getting the following error.

[AcuCorp, Inc.][AcuODBC Driver]Expected lexical element not found: <identifier> expected, SELECT found, near line 1, column 46



SELECT sclev.MktDesc AS CategoryName, 
(SELECT TOP 1 'http://" & customDomain & "/go.asp?prog=lvl3&lastprog=&pend=lvl3&mktlvl1=' + sclev2.MktLvl1 + '&mktlvl2=' + sclev2.MktLvl2 + '&mktlvl3=' + sclev2.MktLvl3 + '®prc=' + {fn CONVERT(xw481.MktSalePrice, SQL_VARCHAR)} + '&embflag=' + xw481.EmbroidFlag AS BUYURL
FROM (sclev AS sclev2 LEFT OUTER JOIN sclevidx ON sclev2.MktLvl1=sclevidx.MktLvl1 AND sclev2.MktLvl2=sclevidx.MktLvl2 AND sclev2.MktLvl3=sclevidx.MktLvl3) LEFT OUTER JOIN xw481 ON sclev2.MktLvl1=xw481.MktLvl1 AND sclev2.MktLvl2=xw481.MktLvl2 AND sclev2.MktLvl3=xw481.MktLvl3
WHERE sclev2.MktLvl3 <> ''
AND xw481.MktSalePrice<>0
AND sclev2.MktLvl3 = sclev.MktLvl3) AS BUYURL,
sclev.MktLvl3 AS SiteSku,
sclev.MktDesc AS description
FROM sclev
WHERE sclev.MktLvl3 <> ''
GROUP BY sclev.MktLvl3


Any help would be greatly appreciated.
   

- Advertisement -