VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 General help me questions
 Date Fromat Problem MSSQL 2005
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Steve2507
VP-ASP Expert

590 Posts

Posted - November 19 2011 :  13:54:33  Show Profile  Reply with Quote
Hi,

We are in the process of moving servers and the new server has MSSQL 2005 (we are currently using MSSQL 2000).

Everything is going fine apart from a problem with the date format.

For the also bought feature we are getting the following error:
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. 
/shopalsobought.asp, line 142

The code it is referring to is this:
Sub Getalsoboughtproducts (incatalogid, productlist)
dim orderdbc, orderlist, ordermax, count, productmax, catalogid
dim orderdate, sql, rc, rs, orderid, months
orderlist=""
productlist=""
months=getconfig("xalsoboughtmonths")
if months="" then months=12
orderdate =dateadd("m",-months,date())
count=0
ordermax=50
productmax=50
' bypass if mysql which cannot handle sql  HK
' xxx

openorderdb orderdbc
sql="SELECT oitems.catalogid, orders.orderid FROM orders "
sql=sql &  " INNER JOIN oitems ON orders.orderid = oitems.orderid "
sql=sql &  " WHERE (orders.odate>=" & datedelimit(orderdate) 

	'VP-ASP 6.50 - show parent product instead of child product
	dim ishighersql, ishigherrs
	ishighersql = "select hassubproduct from products where catalogid = " & incatalogid
	set ishigherrs=orderdbc.execute(ishighersql)
	if not ishigherrs.eof then
		if ishigherrs("hassubproduct") = "Yes" then
			sql=sql &  "  AND oitems.catalogid IN (select catalogid from products WHERE highercatalogid = " & incatalogid & "))"
		else
			sql=sql &  "  AND oitems.catalogid=" & incatalogid & ")"
		end if
	else
		sql=sql &  "  AND oitems.catalogid=" & incatalogid & ")"
	end if

	closerecordset ishigherrs

'debugwrite sql
set rs=orderdbc.execute(sql)

Line 142 refers to the last line in the above code.

Pulling my hair out at this so any help appreciated.


Steve
Sex toys from a UK sex shop including vibrators and dildos.

Steve2507
VP-ASP Expert

590 Posts

Posted - November 19 2011 :  15:57:38  Show Profile  Reply with Quote
Worked it out.

The problem is the datedelimit. It needs to be avoided with MSSQL 2005


Steve
Sex toys from a UK sex shop including vibrators and dildos.
Go to Top of Page

diegomilito
VP-ASP Expert

Argentina
723 Posts

Posted - January 14 2012 :  02:35:15  Show Profile  Reply with Quote
Hey, steve, it is usually date format in the server issue from your initial read. How did you solve it anyway ?

Diego.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000