473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 help me?

Thanks

Thomas
Dec 17 '07 #1
2 8495
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 helps.

Dan Guzman
SQL Server MVP

<Th*******@gmail.comwrote in message
news:dd**********************************@w56g2000 hsf.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 help me?

Thanks

Thomas
Dec 17 '07 #2
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 help me?

Thanks

Thomas

You need to express date values in universal YYYYMMDD HH:MM:SS format
Dec 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sdash | last post by:
I'm working on a simple formview screen that should update a SQL Server 2000 record. I'm sure there must be something simple wrong, but when I press update, the screen refreshes and the changes...
1
by: BabuMan | last post by:
Hi, I have a FormView control on a page which is bound to a SQLDataSource table. Everything works fine except for the "Update". I get an InvalidCastException. The problem only seems to surface...
5
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new...
5
by: BenG | last post by:
Hi. I have a gridview control on a web form (asp.net 2.0) that's bound to a objectDataSource. The objectdatasource which is bound to a class I've written in the DAL to read and update the database....
0
by: Luigi | last post by:
Hi all, I have the GridView with this code: <asp:GridView OnDataBound="VisualizzaExcel" EnableViewState="False" ID="GridView1" runat="server" AutoGenerateColumns="False"...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
5
by: =?Utf-8?B?UlBhcmtlcg==?= | last post by:
I used the wizard to generate a typed dataset for my table and let it create my SPROCs. It created everything, and the GetData() method and the custom GetByUserName query works great, but when I...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
5
by: handoyo | last post by:
Hi all,i'm trying to show updated data in existing html td.. For example i got column that show last modified datetime,then i want to update data again,the column will changed to current time without...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.