Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 date isse

Author  Topic 

sharathkatpally
Starting Member

4 Posts

Posted - 2009-03-25 : 11:21:42
Hello,
I trying to do a select statement with a where clause on column name [INTGRT_TRX_DT]. The data is in this form.

2008-12-15 04:36:20.223
2008-12-15 04:36:19.887
2008-12-15 04:36:19.727
2008-12-15 04:36:19.687
2008-12-15 04:36:19.650

select * from table1 where [INTGRT_TRX_DT] = '2008'.

I tried doing
select * from table1 where datename[year,[INTGRT_TRX_DT]] = '2008'.
Its giving error.
please help

thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-03-25 : 11:36:55
select * from table1 where year(INTGRT_TRX_DT) = 2008

Webfred



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-25 : 12:45:45
to make use of index on INTGRT_TRX_DT if exists

select * from table1 where INTGRT_TRX_DT >= '20080101' AND INTGRT_TRX_DT <'20090101'
Go to Top of Page
   

- Advertisement -