arthi.anan (10/24/2012)
Thanks a lot...I got it right..
Here in this procedure i have a problem with date formats. In my data the format is DD-MM-YYYY (13-Aug-1951)
I should declare in my temp table as a string and using date convert i should be able to match it to the date format in employees table...
How do i use a convert function in this procedure and where should i declare it?
You should use style 105 to convert dd-mm-yyyy string to date. I'm posting you an example.
declare @var varchar(20)
set @var = '24-10-2012'
print @var
declare @date date
set @date = convert(date,@var,105)
print @date
declare @var varchar(20)
set @var = '24-Oct-2012'
print @var
declare @date date
set @date = convert(date,@var,105)
print @date
Regards
IgorMi
Igor Micev,My blog: www.igormicev.com