string to currency
I am quering a datebase table from an asp page, comparing values that the user input in a form, value is a string 1000000 and the field in the database that i am compparing from is a currency type, i am getting an error saying that i need to convert to currency, type mistmatch. i am using the following to convert but it does not work, any suggestions.
here is my query:
"SELECT STotalAllocation FROM tabletoquery where STotalAllocation >='" & CCur(Session("plusMillion")) & "' "
[green]'Session("plusMillion") is equal to 1000000[/green]
this is the error:
Microsoft OLE DB Provider for SQL Server (0x80040E07)
Disallowed implicit conversion from data type varchar to data type money, table 'SiteDetail7CMaster', column 'STotalAllocation'. Use the CONVERT function to run this query.
search_report.asp, line 136
SELECT STotalAllocation FROM tabletoquery where STotalAllocation >= " & CCur(Session("plusMillion"))
I believe the problem is that you have single quotes around the value.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)