Hi,
I'm using sql 2000, and I like to know how to convert current date to year
(eg. 2006).
Thanks,
Sarahhow about year() function?
select year(getdate())
alternatively
select datepart(year, getdate())
peter
"Sarah" <sguo@.coopervision.com> wrote in message
news:Ozv2yxQSGHA.4752@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm using sql 2000, and I like to know how to convert current date to year
> (eg. 2006).
> Thanks,
> Sarah
>|||like this
SELECT DATEPART(yyyy,GETDATE())
or like this
SELECT DATEPART(yyyy,CURRENT_TIMESTAMP)
http://sqlservercode.blogspot.com/|||select YEAR(getdate())
"Sarah" <sguo@.coopervision.com> wrote in message
news:Ozv2yxQSGHA.4752@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm using sql 2000, and I like to know how to convert current date to year
> (eg. 2006).
> Thanks,
> Sarah
>|||Dear all,
Thanks all for your quick response. Year function works fine.
Thanks so much again,
Sarah
"Sarah" <sguo@.coopervision.com> wrote in message
news:Ozv2yxQSGHA.4752@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm using sql 2000, and I like to know how to convert current date to year
> (eg. 2006).
> Thanks,
> Sarah
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment