Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Errors when going live! concerning dates

Status
Not open for further replies.

abienz

Programmer
Aug 13, 2001
53
GB
Hi there, I hope there's someone out there that can help me with this
problem because it seems to be reccuring and it's driving me nuts!

When I try to run an asp page which displays data from my SQL Server 7 DB
I get this error...

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

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

/processes/Data.asp, line 27

The problem that this refers to is this bit of code...

Dim DateA
Dim DateB

DateA = FormatDatetime("01/07/2001",2)
DateB = FormatDatetime(Date,2)

IF Request(&quot;DateA&quot;) <> &quot;&quot; THEN DateA = Request(&quot;DateA&quot;)
IF Request(&quot;DateB&quot;) <> &quot;&quot; THEN DateB = Request(&quot;DateB&quot;)

set Rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Rs.ActiveConnection = MM_theomn_STRING
Rs.Source = &quot;SELECT * FROM theomn.v_survey WHERE DateInitial > '&quot; & DateA
& &quot;' AND DateExtended < '&quot; & DateB & &quot;'&quot;
Rs.CursorType = 0
Rs.CursorLocation = 2
Rs.LockType = 3
Rs.Open()
Rs_numRows = 0


Now I don't understand why I get this error, because I create this code
locally on my machine and test it using PWS and it comes through lovely,
however when I upload it, I get the error, I always seem to get this
problem when I use dates, are there some basic rules that one should
follow when using dates online?

It's always one rule for local and one rule for the net! grrrr.

Any help would be more than just appreciated!!

Cheers,
Al.
 
Hi,

suggestion : check regional settings on server and see are they different compared to your local maschine.


Wish you luck,
Oliver
 
You're right, I decided to take a look last night on the webserver, the dates were set to English(US) I needed them to be UK, thanks for your reply Oliver!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top