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)
 can i get the date withgout the time from getdate(

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-01-09 : 08:29:17
can i get the date withgout the time from getdate()??
withought to need to start breaking into pieces?

thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-09 : 08:31:22
Select DateAdd(day,DateDiff(day,0,getdate()),0)

Madhivanan

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

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-01-09 : 08:39:39
but it still gives me the time 00:00:00
i want pure time only :)

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-09 : 08:42:46
Where do you want to show the Date without Time?
If you use Front End application, use Format function there although it is possible from Query using Convert function which actually becomes String than Date

Select Convert(varchar(10),getdate(),101)

Madhivanan

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

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2006-01-09 : 08:44:15
[code]
SELECT CONVERT(CHAR(8), GETDATE(), 108)
[/code]
If you need the milliseconds, choose style 114 instead.

--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt? http://www.insidesql.de/blogs
Go to Top of Page
   

- Advertisement -