Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-11-15 : 07:59:43
|
| matthew writes "I've racked my brain (and the net) trying to find the cause for this problem, never mind a solution. The problem is this:I have an ASP web application that works with a SQL Server database. (I know you don't answer ASP questions, that's not the problem :-) ) Working with dates on my system (and a couple test systems) everything works fine. Dates get stored in mm/dd/yyyy format without any issue at all. The problem is that on my clients network, dates get scrambled. On their network, the same date value (say 11/12/2004) gets stored that way on 1 computer but gets stored 12/11/2004 on a couple others. I've looked at the regional settings on each computer (some are XP, some 2000) and they all have the same date settings, the server that stores the DB has the same settings. But the date still gets scrambled. My question is whether there's a way I can force Sql Server to take ALL smallDateTime fields as mm/dd/yyyy format? Some where the date gets scrambled an being able to do that may solve 1/2 the issue." |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-11-15 : 08:53:20
|
| use stored procedures and parameters that accept datetime datatypes to update/retrieve data from your database. You are probably using dynamic SQL to add data to your system. Don't do this -- if you use a parameter of the proper datatype and avoid creating SQL statements "on-the-fly", the format or display of a date is irrelevant.- Jeff |
 |
|
|
DustinMichaels
Constraint Violating Yak Guru
464 Posts |
Posted - 2004-11-15 : 10:00:46
|
| Perhaps the problem is with the language setting in the users browser. Perhaps they are using a language which puts days in front of months when they display dates?Dustin Michaels |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2004-11-15 : 14:29:59
|
| SET DATEFORMAT mdydouble check how the data arrives from the client, log into a table or trace the clients.if you had used sp....rockmoose |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-11-16 : 00:34:18
|
| All of the above, plus:If you send a date to SQL in "text" format use yyyymmdd - SQL server will treat that as being unambiguous.Kristen |
 |
|
|
|
|
|