[dba-SQLServer] Convert DateTime to dd/mm/yyyy

Paul Hartland Paul.Hartland at orridge.co.uk
Wed Mar 8 06:00:12 CST 2006


Darren, 

Try changing the 101 in your CONVERT statement to 

CONVERT(Char(10),BankingDate,103)


PAUL HARTLAND
Database Designer/Programmer
paul.hartland at orridge.co.uk
DDI - 01922 472031
Mobile - 07730 523179


-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Darren
DICK
Sent: 08 March 2006 11:53
To: dba-SQL Server
Subject: [dba-SQLServer] Convert DateTime to dd/mm/yyyy

Hi all
In SQL, I am using convert to basically strip the time portion from a
datetime field
 
IE in the field we have the value...01/31/2005 11:05:34AM What I want is
31/01/2005
 
I have had minor success using Convert
EG convert (char(10), BankingDate, 101)  AS 'BankingDate',  Gives me
01/31/2005 Cool - I have been able to strip the time but it is still in
&^%$#$% North American date format ie mm/dd/yyyy
 
What I want is dd/mm/yyyy - IE 31/1/2005
 
Any suggestions?
 
Many thanks
 
DD
 
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com


_______________________________________________

*  This message is confidential.
*  This email, its content and any files transmitted with it are intended solely for the addressee and may be legally privileged and/or confidential.
*  Access by any other party is unauthorised without the express written permission of the sender.
*  If you have received this email in error you may not copy or use the contents, attachments or information in any way and any review, use, dissemination, forwarding, disclosure, alteration, printing of this information is strictly prohibited. Please destroy it and notify the sender via return e-mail.
*  This email has been prepared using information believed by Paul Hartland to be reliable and accurate, but the company makes no warranty as to accuracy or completeness. In particular the author does not accept responsibility for changes made to this email after it was sent.
*  Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates.

The Orridge web site can be found at:
http://www.orridge.co.uk





More information about the dba-SQLServer mailing list