[dba-SQLServer] Getting rid of time in result set

John W. Colby jwcolby at colbyconsulting.com
Wed Oct 27 22:27:59 CDT 2004


Thanks Stuart.  Is that SQL syntax or SQL Server specific syntax?

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Wednesday, October 27, 2004 11:13 PM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] Getting rid of time in result set


On 27 Oct 2004 at 22:51, John W. Colby wrote:

> How do I get rid of the time in a date column in the result set?
> 
> 2005-01-02 00:00:00.000
> 
> Should be
> 
> 2005-01-02
> 

Convert (myDate,nvarchar(10),10)

The third parameter "Style"  defines the formatting

10 = 2005-01-02
110 = 05-01-02
etc



-- 
Stuart


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com







More information about the dba-SQLServer mailing list