insert datetime into mssql

T

thomas kern

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.ToDateTime()), then it
doesnt work
either.

help, please.
thomas
 
T

thomas kern

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top