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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need to convert Datetime field

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2009-02-04 : 15:27:01
I need to pass the number of seconds as an integer number from a datetime field to a RS report. i.e. value '2009-02-04 00:00:00.000' but I'm not sure what the sql syntax ix.

Any clues?

thx,

John

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-02-04 : 15:33:11
declare @date datetime
set @date = '2009-02-04 00:00:15.000'
select datepart(s,@date)
Jim
Go to Top of Page
   

- Advertisement -