Skip to main content
Participant
July 11, 2006
Question

uk date & sql server

  • July 11, 2006
  • 1 reply
  • 288 views
The following error message is displaying when I try to update my SQL database from an MX update statement

"Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. "

I'm using the LCID 2057 on my asp page however, I know my SQL Server is using US formated date which I can't change. I've search the web , asked a lot of questions and discovered that there is a Convert fix that I could use. CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
now here's the thing where do I use it? On the server? or within the ASP page? and how?

Any help greatly appeciated

This topic has been closed for replies.

1 reply

Inspiring
July 11, 2006
CONVERT only works the other way - changing a SQL Server date (which is
actually a number) to a string with the format you want.

You need to pass the date in a format sure to be recognized. Most SQL
Server developers recommend yyyymmdd (no punctuation) to ensure proper
conversion no matter the user's preferred date style. For instance, today
would be 20060711.



"traq" <webforumsuser@macromedia.com> wrote in message
news:e90goc$rfo$1@forums.macromedia.com...
> The following error message is displaying when I try to update my SQL
> database
> from an MX update statement
>
> "Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char
> data
> type to a datetime data type resulted in an out-of-range datetime value. "
>
> I'm using the LCID 2057 on my asp page however, I know my SQL Server is
> using
> US formated date which I can't change. I've search the web , asked a lot
> of
> questions and discovered that there is a Convert fix that I could use.
> CONVERT
> ( data_type [ ( length ) ] , expression [ , style ] )
> now here's the thing where do I use it? On the server? or within the ASP
> page? and how?
>
> Any help greatly appeciated
>
>
>


traqAuthor
Participant
July 12, 2006
Sorry I'm feeling rather blonder than normal today.

How do I display the date in a UK format (DD/MM/YYY ) so that it's all nice a clear for the user to update the info, and then send that updated info to the Database in a YYMMDD format . I have to keep the data in a date format because In another area I'm performing queries on the dates to establish number of days between events and things.

thanks for you help