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
 SQL Server Development (2000)
 Get Date Part only...??

Author  Topic 

BuddyRam
Starting Member

17 Posts

Posted - 2007-04-24 : 08:10:46
How can i get date part only from the getdate() function sqlserver?
i dont want timestamp part....

Thanks

Cheers
Ram

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-24 : 08:12:39
[code]
select dateadd(day, datediff(day, 0, getdate()), 0)
[/code]


KH

Go to Top of Page

BuddyRam
Starting Member

17 Posts

Posted - 2007-05-18 : 02:03:03
Hi,
Its giving time part as well like 2007-05-18 00:00:00
I dont want htis 0s as well any ideas please?
I ned pure date part...
thanks

Cheers
Ram
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-18 : 02:09:53
Either
SELECT Convert(varchar(10), getdate(), 101)


OR

Use your front-end format function (recommended)

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-18 : 04:31:17
<<
I ned pure date part...
>>

where do you want to show pure date part?

Madhivanan

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

- Advertisement -