Sunday, February 19, 2012

Date Conversion

code:
SET @.Yr = 1986
Set @.Datum = '1/1/' & @.Yr
Hi, I am experiencing a problem with the "Set @.Datum " statement. Does
anyone know how would I use the cast function to convert this, " '1/1/'
& @.Yr " to be put into my DateTime var,@.Datum?
Thanx.
try this
SET @.Yr = 1986
Set @.Datum = '1/1/' + cast( @.Yr as varchar)
vt
"amatuer" <njoosub@.gmail.com> wrote in message
news:1163143392.775333.101750@.h48g2000cwc.googlegr oups.com...
> code:
> SET @.Yr = 1986
> Set @.Datum = '1/1/' & @.Yr
>
> Hi, I am experiencing a problem with the "Set @.Datum " statement. Does
> anyone know how would I use the cast function to convert this, " '1/1/'
> & @.Yr " to be put into my DateTime var,@.Datum?
>
> Thanx.
>

No comments:

Post a Comment