Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 ASP Error: Product Search by Price
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kendiala
VP-CART New User

57 Posts

Posted - August 18 2004 :  10:33:36  Show Profile  Reply with Quote
I have a shop set up using a SQL db. When we go to the products page in the admin section and try to search for products based on cprice, we get the following error:

Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type money to varchar is not allowed. Use the CONVERT function to run this query.

The cprice field in the Products table is set to money, so I guess it has something to do with that. But I'm not sure what the problem is. Does anyone have any ideas?

devshb
Senior Member

United Kingdom
1904 Posts

Posted - August 18 2004 :  11:58:06  Show Profile  Visit devshb's Homepage  Reply with Quote
I remember having this problem too, but I can't remember how I got round it. Sorry that's not much help, but at least it might give you a pointer towards what needs changing:

When you enter a value into the "where" field for a query on the standard table-query admin screens, it always treats those values as character strings, so the generated sql will end up something like:
select * from products where cprice='50'
or
select * from products where cprice like '50%'

this means that the sql engine will automatically try to translate one datatype to the other, in this instance it'll try to turn the cprice column value from money to varchar (character) for the query, which sqlserver obviously doesn't like.

what you could do is try the advanced query admin menu and enter your full sqlstatement in there as:

select * from products where cprice=50

that should give you the summary results, and with that you can also use <, <=, >, >= etc.

eg:
select * from products where cprice<=50

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on August 18 2004 12:00:11
Go to Top of Page

kendiala
VP-CART New User

57 Posts

Posted - August 18 2004 :  13:26:59  Show Profile  Reply with Quote
Thanks, Simon. That's very helpful!

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00