|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I have a table which has a column of type datetime,i want to write a query where i can get only year from my datetime column. 2004-11-16 00:00:00.000 this is the one which i have i required only 2004 on selecting. Thanks in Advance Raj |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Wed, 8 Oct 2008 19:06:09 -0700 (PDT), raj <2rajesh.b@gmail.com>
wrote: >I have a table which has a column of type datetime,i want to write a >query where i can get only year from my datetime column. > >2004-11-16 00:00:00.000 this is the one which i have i required only >2004 on selecting. SELECT datepart(year,datetimecolumn) FROM Whatever Note that this returns an INT datatype. Roy Harvey Beacon Falls, CT |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Oct 9, 3:06am, raj <2rajes...@gmail.com> wrote:
> Hi, > > I have a table which has a column of type datetime,i want to write a > query where i can get only year from my datetime column. > > 2004-11-16 00:00:00.000 this is the one which i have i required only > 2004 on selecting. > > Thanks in Advance > Raj select year(datetimecolumn) from table |
|
![]() |
| Outils de la discussion | |
|
|