Date Formats

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
 
V

Vadivel Kumar

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

Vadivel Kumar
http:\\charpblogs.blogspot.com
 
N

Nick

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
 
I

IPGrunt

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
 
M

Matt Berther

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top