PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > Update Column with Type datetime
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Update Column with Type datetime

Réponse
 
LinkBack Outils de la discussion
Vieux 17/12/2007, 08h52   #1
Thomas609@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Update Column with Type datetime

Hi,

I want to update a column typed datetime. My statement is:

update 'tablename' set Datum_Ende = '2007-12-17 08:49:04.000' where
'columnID_name' = 23250 and 'columndate_Name' = convert(datetime,
'17.12.2007 08:08:04')

This effects an error. The Server said, the dateTime value is out of
valid Domain.

I have tried various statements like this and i think, the problem is
the blank between date and time.

Can someone me?

Thanks

Thomas
  Réponse avec citation
Vieux 17/12/2007, 12h32   #2
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update Column with Type datetime

> I have tried various statements like this and i think, the problem is
> the blank between date and time.


The interpretation of this date string depends on the DATEFORMAT setting. I
suggest you use either of these 2 formats to avoid ambiguity:

'2007-12-17T08:49:04.000'
'20071217T08:49:04.000'

What is the data type of 'columndate_Name'? If the data type is other than
datetime or smalldatetime, you may get an error if the column contains
invalid datetime data.

--
Hope this s.

Dan Guzman
SQL Server MVP

<Thomas609@gmail.com> wrote in message
news:dd9db43c-9580-4fc4-b396-f87fa2b2a7dd@w56g2000hsf.googlegroups.com...
> Hi,
>
> I want to update a column typed datetime. My statement is:
>
> update 'tablename' set Datum_Ende = '2007-12-17 08:49:04.000' where
> 'columnID_name' = 23250 and 'columndate_Name' = convert(datetime,
> '17.12.2007 08:08:04')
>
> This effects an error. The Server said, the dateTime value is out of
> valid Domain.
>
> I have tried various statements like this and i think, the problem is
> the blank between date and time.
>
> Can someone me?
>
> Thanks
>
> Thomas


  Réponse avec citation
Vieux 18/12/2007, 12h53   #3
Madhivanan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update Column with Type datetime

On Dec 17, 1:52 pm, Thomas...@gmail.com wrote:
> Hi,
>
> I want to update a column typed datetime. My statement is:
>
> update 'tablename' set Datum_Ende = '2007-12-17 08:49:04.000' where
> 'columnID_name' = 23250 and 'columndate_Name' = convert(datetime,
> '17.12.2007 08:08:04')
>
> This effects an error. The Server said, the dateTime value is out of
> valid Domain.
>
> I have tried various statements like this and i think, the problem is
> the blank between date and time.
>
> Can someone me?
>
> Thanks
>
> Thomas



You need to express date values in universal YYYYMMDD HH:MM:SS format
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12074 seconds with 11 queries