Date Format as British  
Author Message
JimBeam





PostPosted: Wed Nov 30 05:18:20 CST 2005 Top

SQL Server >> Date Format as British

Hi All,

I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
Database. What I will have to do for this.

TIA

SQL Server97  
 
 
Andrea





PostPosted: Wed Nov 30 05:18:20 CST 2005 Top

SQL Server >> Date Format as British hi Kamal,

> Hi All,
>
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in
> my Database. What I will have to do for this.
>
this "setting" is login's related, that's to say it depend on the login's
language property, but it can be set using
SET DATEFROMAT xxx
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_set-set_052s.asp)
for input...

please have a look at http://www.karaszi.com/SQLServer/info_datetime.asp
too..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply


 
 
AbsarAhmad





PostPosted: Wed Nov 30 05:21:02 CST 2005 Top

SQL Server >> Date Format as British Hopefully following posting can help you:

http://www.microsoft.com/technet/community/newsgroups/dgbrowser/en-us/default.mspx?query=stored+procedure+to+accept+dates+in+the+format&dg=microsoft.public.sqlserver.server&cat=en-us-technet-sqlserv&lang=en&cr=US&pt=261BA873-F3AB-420E-96D6-E3004596A551&catlist=328BAFD2-1A81-4558-B1DE-B6EB49F31B7E&dglist=&ptlist=&exp=&sloc=en-us



> Hi All,
>
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database. What I will have to do for this.
>
> TIA
>
>
>
 
 
David





PostPosted: Wed Nov 30 05:46:53 CST 2005 Top

SQL Server >> Date Format as British
> Hi All,
>
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database.

Why? DATEFORMAT is set in each connection so the database setting is
pretty redundant. Best practice is to ignore the DATEFORMAT setting and
write code that performs correctly however this may be set. Crucially
this means that any hard-coded dates should be coded in ISO rather than
local format:

'YYYYMMDD'
or
'YYYY-MM-DDThh:mm:ss'
or
'YYYY-MM-DDThh:mm:ss.mmm'

All other date values should be handled as DATETIME or SMALLDATETIME
(which are unaffected by the format setting) or converted from strings
using the CONVERT style property.

--
David Portas
SQL Server MVP
--