View Single Post
  #1 (permalink)  
Old August 21st, 2006, 10:47 AM
kkrish kkrish is offline
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error converting datetime from character st

For the following proc:

CREATE PROCEDURE sample
@createdate datetime
AS

Declare @Str varchar(8000)
SET @Str = 'SELECT * from table_name
where CreationDate = "'+convert(datetime,@createdate,101)+'" AND
ID = Number'.
Exec(@Str)

I am getting the error

"Syntax error converting datetime from character string"

Please help.

Thanks.

Reply With Quote