Date Formats

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the date
is entered into the database, it thinks its in US format and switches the
month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT dmy'
which I though was supposed to tell SQL that incoming dates are in the
format specified, rather than the default mdy.

Can anyone help?

Thanks
 
Did you checked up by changing your
machine date format (Regional Settings)
to UK type?

Vadivel Kumar
http:\\charpblogs.blogspot.com
 
Yes - All the PC settings are UK English.


Vadivel Kumar said:
Did you checked up by changing your
machine date format (Regional Settings)
to UK type?

Vadivel Kumar
http:\\charpblogs.blogspot.com
 
Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the date
is entered into the database, it thinks its in US format and switches the
month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT dmy'
which I though was supposed to tell SQL that incoming dates are in the
format specified, rather than the default mdy.

Can anyone help?

Thanks

What is your default language set to? It defaults to English, which is
American english, and will do a mdy format.

You want British English, which defaults to dmy

You can do this in Enterprise manager (Server properties), with the SET
LANGUAGE command in your script, or with sp_setdefaultlanguage (look that
one up...I may have it wrong).

-- ipgrunt
 
Hello Nick,

This is because the language specified in the sql server install is US English.
What happens when you pull the date back out of the sql server?

I'm guessing it comes back in UK format.
 
Back
Top