I have a selection of sql code that I keep getting an ‘Incorrect syntax’ error on.
I cannot see what is causing the issue.
Can anyone point out the obvious to me? I maybe have been staring at the code for too long to see it now!!
My code is :-
DECLARE @CostCatID AS Int
SELECT * FROM vwREP_GP_ContractProjectPurchaseRpt
WHERE PACOSTCATID IN (@CostCatID)
AND (DOC_DATE >= @DateFrom)
AND (DOC_DATE <= @DateTo)
order by 1
and the full error message I get is:-
Incorrect syntax near ‘;’
I know it is going to be obvious to most people but for the life of me in my tired state I cannot get this to work.
Thanks in advance.
(all work is being done in sql Server Management Studio 2005)
>and<? Why are you encoding>and<? There’s your problem. Try: