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 time

Author  Topic 

Chinni
Yak Posting Veteran

95 Posts

Posted - 2008-09-08 : 10:36:41
select dateadd(dd,-(datepart(dy,getdate())-1),getdate())

2008-01-01 10:35:33.693

but i would like to have time also as 00.00.00

thanks

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-08 : 10:45:41
Input and output examples, please.

Boycotted Beijing Olympics 2008
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-08 : 10:50:05
Is this?

select dateadd(year,datediff(year,0,getdate()),0)


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Chinni
Yak Posting Veteran

95 Posts

Posted - 2008-09-08 : 11:41:01
thanks a lot
Go to Top of Page
   

- Advertisement -