August 25, 2010 at 7:40 am
declare @a varchar(50)
declare @b-2 varchar(20)
set @b-2=(select gender from table where Cov='101')
set @a=@b + convert(datetime,'24/08/2010',103)
select CoveNoteNo from tableccr where Riskstart=@a
the above query i m using to fetch data frm a table in database . now in my table the
date is stored as 2010-08-24 00:00:00.000 and the datatype is datetime.
now when i run this query i m getting error:
Msg 241, Level 16, State 1, Line 4
Conversion failed when converting datetime from character string.
i know that i m getting this error because i am trying to concatonate a datetime value to
varchar, but i want it in this fashion only.
i want this same query to run beceause i m using same type of query in other program.
i want a right query .
August 26, 2010 at 7:07 am
this has eliminated the error but now no data is comming .
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply