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!

SQL error Divide by Zero from ASP

Status
Not open for further replies.

SpriteInMe

Programmer
Dec 8, 2000
4
CA
I use SQL 7.0 with my ASP and simply do a select statement.
Here is a snippet of my code:

cmd = "Select HolidayDate from HolidayMaster where HolidayDate = " & ShipDate & " and TerminalId = " & OrigTerminal
rs.Open cmd,cn
if rs.EOF then
ok = true
else

...

The following error appears on the "rs.open cmd,cn" line in my browsers window:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Divide by zero error encountered.

/TransitTimeCalc.asp, line 117


When I use the Query Analyzer to run the select statement, it is fine. A duplicate site on another server works fine.

Any suggestions would be greatly appreciated!!!
 
Sorry, forgot to mention that I had already tried the "Set Arithabort Off" without success.
 
Hi, put the shipdate field in quotes like this:

"Select HolidayDate from HolidayMaster where HolidayDate = '" & ShipDate & "' and TerminalId = " & OrigTerminal


I believe that should do it...

Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top