Re: Date settings with SQL Server 2000

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Hari (hari_prasad_k_at_hotmail.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 13:22:34 +0530

Hi,

Have a look into "SET DATEFORMAT" command in books online.

Sample:

SET DATEFORMAT dmy
GO
DECLARE @var1 datetime
SET @var1 = '31/12/03'
SELECT @var1
GO

Thanks
Hari
MCDBA

"Totto" <taa.nospam@norcon.no> wrote in message
news:u1ggFlbLEHA.2736@TK2MSFTNGP11.phx.gbl...
> Hi,
> I have a "Closed" system (SCADA)i.e not changable, that is storing to SQL
> Server 2000.
> The date format from the SCADA system is dd.mm.yyyy but the SQL server
only
> wants yyyy.mm.dd. How do I change the date format in SQL Server 2000 to
> recognise the format from the SCADA system.
> Tnx
> Totto
>
>



Relevant Pages

  • Re: Date and Time
    ... format i must put the directive (set dateformat) ... ... > absolutely no point to trying to store a datetime with any format. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Determine 1st day of each month
    ... SET LANGUAGE US_ENGLISH ... SET DATEFORMAT DMY ... The only safe format in SQL Server, when converting from string to date, is ... Every other format will require care... ...
    (microsoft.public.sqlserver.programming)
  • Re: Date in SQL insert
    ... bear in mind that if you do not follow Andrea's advice to use ISO ... > you can use the SET DATEFORMAT xxx hint, ... > but please keep in mind the format SQL Server better accepts, ...
    (microsoft.public.sqlserver.msde)
  • Re: Does SET DATEFORMAT only set the format for the session?
    ... alter the current session handling of specific information. ... SET DATEFORMAT is one such SET Function which will chage the date format for ... > Can anyone confirm that if I use SET DATEFORMAT that it ... > will only change the date format for the SQL session and ...
    (microsoft.public.sqlserver.server)