473,666 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert datetime into mssql

hi,

i tried to insert a record into a mssql-table.
one column is DateTime.
i tried this one:
insert into fixtures (dategame) VALUES ('24.01.2003')
unfortunately i receive an error

-- error --
The conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value.
The statement has been terminated.
-- error --

if i change 24.01.2003 to 01.24.2003 it works perfectly. now i am curoius.
doenst work MICROSOFT asp.net with MICROSOFT mssql ?
i mean if i convert the value to datetime (Convert.ToDate Time()), then it
doesnt work
either.

help, please.
thomas
Nov 18 '05 #1
1 2439
found it myself.
if anyone is interested, i had to set the dateformat in my sql-statement.

set dateformat dmy
insert into XXX (XXX) VALUES ('30.10.2004')

thanks
Nov 18 '05 #2

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

Similar topics

9
3455
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM, VARCHAR(10) WO.PROBLEMCODE, VARCHAR(8)
14
36972
by: Andre | last post by:
Hello Can anyone help me translate this from access so that it can work in mssql (i need to get next value, but cannot use identity as if row is deleted, another must get new next column number which would be same as deleted one) Access; INSERT INTO table SELECT (IIF(code<>Null,MAX(code)+1,1) AS code, 0 AS usercode FROM table
2
13962
by: Ian Hinson | last post by:
Hi, Sometimes I find it handy to construct an sql string for action queries, and then run it directly against the database and/or connection instead of using Recordsets for simple updates. eg. This query works in MS Access (using dbs.Execute): UPDATE Customer SET LastContact = #2/5/2005 13:15:00# WHERE Customer.CustomerID = 101;
10
33651
by: Stefan Richter | last post by:
Hi, I am trying to enter data into a table, but I got problems with my sql statement. It's something like that: Dim now As String = DateTime.Now.ToString INSERT INTO table (date) VALUES(now) I know there is also ToShortDateString but it didn't change my String in anyway.
4
8667
by: Arpan | last post by:
A SQL Server 2005 DB table has 4 columns namely "ID" (IDENTITY int column), "FirstName" (varchar(50)), "LastName" (varchar(50)) & "DOB" (datetime). Now when I am trying to add a new row using the following INSERT statement: sqlDapter.InsertCommand = New SqlCommand sqlDapter.InsertCommand.CommandText = "INSERT INTO UserDetailss VALUES('bobby','simpson','" & Now() & "')" sqlDapter.InsertCommand.Connection = sqlConn sqlDapter.Update(dSet,...
0
2221
by: tezza98 | last post by:
HI i am using BULK INSERT to copy data from a text file into a table that already exists BULK INSERT dbo.TRANStemp FROM 'D:\MSSQL\Data\TRANS.csv' WHERE dbo.TRANStemp.DateTime <> WITH ( FIRSTROW = 2, FIELDTERMINATOR = '\t',
0
1664
by: gpspocket | last post by:
help me -CURSOR backward insert from End Date > to Start Date how to insert dates from end to start like this SELECT 111111,1,CONVERT(DATETIME, '17/03/2008', 103), CONVERT(DATETIME, '01/03/2008' i explain i have stord prosege that create mod cycle shift pattern and it working ok
1
2882
by: BenB | last post by:
Hello, A try: I have got an application which runs smoothly under Windows 2003 server with SQLserver 2005. No problems at all... The database is installed on the same server as the application. We are working on redundancy, so we have installed this application under VMWare. This VMWare is running at a dedicated VMWare hardware. In the VMWare, the rest is (or should be) similar: windows 2003 server, MSSQL server 2005, the...
2
2621
by: akronymn | last post by:
I have an mssql database that I need to migrate to mysql. For some reason though any queries to any columns of type datetime are returned in French in the following format: 7/avr/2004 14:00 This also includes all the text of an SQL dump which not surprisingly makes mysql unable to read the dump from the MSSQL db. I've checked that my windows regional setting is set to English. I'm at a loss as to why this is happening or how to fix it. I...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.