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)
 get Round of getdate()

Author  Topic 

ranjeetsingh_6
Posting Yak Master

125 Posts

Posted - 2008-03-01 : 04:20:58
Hi,
i write a query

select getdate()

suppose output come '2008-03-01 14:08:52.187'

i want to get like this output

'2008-03-01 14:09:00'

means want to neglate second and milisecond part and want round of getdate()



Ranjeet Kumar Singh

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-01 : 07:53:48
select convert(smalldatetime, getdate())


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -