Re: Update a date
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 03/10/04
- Next message: Raymond D'Anjou \(raydan\): "Re: Update a date"
- Previous message: Tibor Karaszi: "Re: backup log <my database> with no_log"
- In reply to: Robert Batt: "Update a date"
- Next in thread: Raymond D'Anjou \(raydan\): "Re: Update a date"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 15:37:26 +0100
You are doing integer arethmics in your query, as you don't enclose the date
inside single quotes. Also, always use a language neutral datetime format
(see end of post), or make sure you SET DATEFORMAT first.
Examples of language neutral formats:
'19980523 00:00:00' --You can leave out time portion
'1998-05-23T00:00:00'
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp "Robert Batt" <anonymous@discussions.microsoft.com> wrote in message news:4E8DA035-D6B2-4B73-8179-43754AB7744D@microsoft.com... > Hello, > I simply wish to update a date field in a sql database table to a new date. the column is of type smalldatetime > > I have tried the following and it just updates the date to 1900-01-01 which is not good. > > Update mytable set MyNewDate = 27/03/2004 > Where MyIndex key = 663 > > Any ideas in this seemingly simple query would be appreciated > > Robert
- Next message: Raymond D'Anjou \(raydan\): "Re: Update a date"
- Previous message: Tibor Karaszi: "Re: backup log <my database> with no_log"
- In reply to: Robert Batt: "Update a date"
- Next in thread: Raymond D'Anjou \(raydan\): "Re: Update a date"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|