Hi,
I am trying to use datetime variable inside dynamic sql. it is giving me this error
Syntax error converting datetime from character string.
here is the sample code that I am running...
DECLARE @pStart DATETIME
SET @pStart = '10/27/2005'
DECLARE @queryString VARCHAR(8000)
SET @queryString = 'SELECT ' + @pStart
SELECT @queryString
Please let me know where I am doing wrong?
Thanks,
Sridhar.