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-Cart StoreFront Customer Forum

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

 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  

VP-ASP 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?

Senior Member

United Kingdom
1898 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'
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.

select * from products where cprice<=50

Simon Barnaby
[email protected]
Web Design, Online Marketing and VPASP addons

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

VP-ASP 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