Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Date Format

Status
Not open for further replies.

rzirpolo

Programmer
Apr 8, 2002
163
GB
There are a number of posts when it comes to date format but these all seem to be in regards to when writing SQL syntax.

In Query Analyzer when I open any table that has a datetime column the format is "1999-04-01 00:00:00.000". How can I amend this so that it just reads DD-MM-YYYY i.e. "01-04-1999".

I thought SQL Server was mapped against my Regional Settings but this does not seem to be the case ?


 
SELECT convert(varchar(12), myDateField, 105) FROM myTable

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
That's if I am doing a specfic select statement. What if in Query Analyzer I right click on User Table and simply click open to display the full table information ?

Your example is if I am running a SELECT statement which is of no use.

I want the date format to default to DD-MM-YYYY throughout SQL on my PC.



 
DOH - sorry - I misunderstood the question.

I'm not sure that you can change that - it's just the raw view of the table...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Also.. typing DBCC USEROPTIONS I get the following information,

Set Option Value
------------------------- ------------
textsize 64512
language British
dateformat dmy
datefirst 1
quoted_identifier SET
arithabort SET
ansi_null_dflt_on SET
ansi_defaults SET
ansi_warnings SET
ansi_padding SET
ansi_nulls SET
concat_null_yields_null SET

The dateformat is dmy and the language British. I can't see why my SQL isn't reflecting this ?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top