kendiala
VP-CART New User
57 Posts |
Posted - August 18 2004 : 10:33:36
|
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
|
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 |
|
|