You can set date in an universal format 'yyyymmdd',
or use convert(datetime,'dd/mm/yyyy',103) function, see MS SQL Help or
[url]http://www.karaszi.com/SQLServer/info_datetime.asp[/url]
Vlastik
"Steve" <steve.hendersonbtinternet.c0m> píše v diskusním příspěvku
news:uBIy7ljTFHA.2520TK2MSFTNGP09.phx.gbl...by> Hi,
>
> I've written a short aspx file so that end users can insert lines into our
> SQL server database. The following string is sent by Internet Explorer to
> the database where it updates the relevant table -
>
> INSERT INTO Tbl_Manual([Data Date],[Staff ID], Flag1, Flag2, Flag3, Ref1,
> Ref2, Timestamp, Inputter) values('15/05/2005', '89', '1', '0', '0', '77',
> '8', '01/05/2005 08:54:10', 'HOME\username')
>
> The 2nd date is sent as a string into an nvarchar field so it causes no
> problems but the first (which is heading for a datetime field) is assumeddd/MM/yyyy> SQL to be MM/dd/yyyy format no matter what I try to do. All regional
> settings are set to UK English & the table in SQL correctly uses> format so the above insert command fails thinking that I'm trying to add a
> date of the 5th of month 15.
>
> If I try input a date as mm/dd/yyyy format into the aspx page, an error is
> thrown back.
>
> Any ideas as to what's going wrong ?
>
> Thanks
>
> Steve
>
>
Bookmarks