CAST as money does not work for varchar in SQL 2000
I have the following SQL command issued from a C# Windows application.
SELECT count(distinct ACCOUNTNUMBER) FROM Extract WHERE (TransactionType = 'CASH_WD' OR (CAST(CASHOUTAMOUNTINSPLITDEPOSIT as money) > 0 and TransactionType = 'WITHDRAWAL' and cast(transactionamount as money) > '3000')) and TaxIdOrSSN = '043305700'
It works fine in SQL Server 2005 but it's failing in SQL Server 2000 with this message:
Implicit conversion from data type varchar to money is not allowed. Use the CONVERT function to run this query.