October 2, 2006 at 3:18 am
Hi,
I am getting the following error: Cannot convert a char value to money. The char has incorrect syntax. with the following bit of SQL. I have tried converts and cast as money but it didn't work. Can someone please tell me why I get this error. It only seems to happen in SQL server 2005 as in SQL Server 2003 ti works fine.
SELECT DISTINCT details, sku, MFID, cost, price, stock, description, idProduct, listPrice, bToBPrice, smallImageUrl, PercentageInc
FROM dbo.qryProdSearch
WHERE (cost * PercentageInc + cost >= 0) AND (cost * PercentageInc + cost <= 9999999999) AND (listHidden = 0) AND (active = - 1) AND (CustomerType = 1)
AND (stock > 2) AND (cost > 0.01) AND (description LIKE '%bluetooth%') OR
(cost * PercentageInc + cost >= 0) AND (cost * PercentageInc + cost <= 9999999999) AND (listHidden = 0) AND (active = - 1) AND (CustomerType = 1)
AND (stock > 2) AND (cost > 0.01) AND (MFID LIKE '%bluetooth%')
ORDER BY description
Thank very much
Reet.
October 2, 2006 at 3:33 am
Hi Reet,
if you need some help with conversion error, you should post table DDL (definitions, best in CREATE TABLE statement) and some sample data on which we can reproduce the error.
BTW, check delimiters (. or ,). If decimal places in the char column are delimited with "," and server is set to work with "." (or vice versa), conversion will fail.
Also, I'm not sure whether this was the best place to post this question, since it is T-SQL for SQLS 7 and 2000, and you get the error in SQLS 2005... but if you post more info, you should get some help anyway.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply