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 2000 Forums
 Transact-SQL (2000)
 Split time

Author  Topic 

lauramayer
Posting Yak Master

152 Posts

Posted - 2005-03-14 : 10:40:16
Morning,

I have a relatively easy question that keeps eluding me. I need to get a peice of time What I have is:

select CONVERT(char(30), CURRENT_TIMESTAMP )as time

which returns Mar 14 2005 10:34AM

I would like it to return Mar 14 2005 10:00AM

like the round fuction does:

select ROUND(CONVERT(char(30), CURRENT_TIMESTAMP)),2)as time

but I can't make it do what I want.

Any thoughts would be appreciated.

Thanks

Laura

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-14 : 10:48:02
like so:
SELECT GetDate(), convert( varchar(30), DATEADD(hh, DATEDIFF(hh, 0, GetDate()), 0) )

Go with the flow & have fun! Else fight the flow
Go to Top of Page

lauramayer
Posting Yak Master

152 Posts

Posted - 2005-03-14 : 10:53:24
Bloody brilliant :) Thanks so much

Laura
Go to Top of Page
   

- Advertisement -