Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove time from date time. 1

Status
Not open for further replies.

bloko

Programmer
Feb 22, 2010
26
GB
I need to group by date but the format of the date is date time so is coming out like

23/01/2009 14:05:52

I need to get rid of the time, what function can I use to delete the last 10 character?
 
Code:
SELECT DATEADD(dd,0,DATEDIFF(dd,0,GETDATE()))

Of course instead of GETDATE() you should use your fields from the table.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Fantastic, just what I was after. Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top