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

Paul Hartland Paul.Hartland at orridge.co.uk
Wed Mar 8 06:33:54 CST 2006


Just glad I could help, this list has helped me so many times. 


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 12:30
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] Convert DateTime to dd/mm/yyyy

Brilliant
Paul you da man

Many thanks

DD

 

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul
Hartland
Sent: Wednesday, 8 March 2006 11:00 PM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] Convert DateTime to dd/mm/yyyy

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


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

_______________________________________________
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