Trunc(date)

Hi....

I am new to SQL Server. I primarily use Oracle which allows me to trunc(date) to removed the timestamp from a date.

Can anyone tell me the equivalent in SQL Server?

Thanks!

Christine

[220 byte] By [ChristineA] at [2007-12-22]
# 1
Yes, you can convert the date to a non-containing string representation, like CONVERT(VARCHAR(10),GETDATE(),112) But you have to keep in mind that storing the string representation in a datetime column this will add the 00:00:00 because this is not separated in SQL Server.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

JensSuessmeyer at 2007-8-30 > top of Msdn Tech,SQL Server,Getting started with SQL Server...
# 2
Thanks for your help Jens!
ChristineA at 2007-8-30 > top of Msdn Tech,SQL Server,Getting started with SQL Server...

SQL Server

Site Classified