jadams0173
Technical User
- Feb 18, 2005
- 1,210
I'm having some syntax problems with this query. I've gotten most of it worked out but still get this error.
I've tried to correct it but I can't seem to get it right. Can someone offer any suggestions.
Code:
ERROR 156: Incorrect syntax near keyword 'SelecT'
Incorrect syntax ner keyword 'aS'
I've tried to correct it but I can't seem to get it right. Can someone offer any suggestions.
Code:
SELECT A.[ID], A.StorageLoc, A.SLRRawCardPN, A.StencilPartNumber, A.StencilRev, A.Customer, A.SLRPartNumber,
A.JobNumber, A.Comments, A.DispositionedAs, A.DispositionedBy, A.DispositionedDate
FROM tblStencils AS A INNER JOIN
[b]SelecT[/b] StencilPartNumber,NOLONGERNEEDED,Left(StencilRev,1) as f2 FROM tblStencils
GROUP BY StencilPartNumber,NOLONGERNEEDED, Left(Stencilrev,1) HAVING Count(*)>1 AND NOLONGERNEEDED=0 [b]aS[/b] B
ON A.StencilPartNumber = B.StencilPartNumber
WHERE A.StorageLoc Like 'SS%'
AND A.Customer=@Customer
AND Left([StencilRev],1)=B.f2
AND A.NoLongerNeeded=0
ORDER BY A.StencilPartNumber, A.StencilRev