Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
alxtech
Yak Posting Veteran
66 Posts |
Posted - 2007-09-28 : 11:16:10
|
| Hello forum,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")) & "' " 'Session("plusMillion") is equal to 1000000this is the error:Error Type: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 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-28 : 11:21:34
|
[code]"SELECT STotalAllocation FROM tabletoquery where STotalAllocation >= " & CCur(Session("plusMillion"))[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
alxtech
Yak Posting Veteran
66 Posts |
Posted - 2007-09-28 : 11:30:20
|
| thanks you are the MAN!!!!why in the world the single quotations ' will kill the query. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-09-28 : 14:32:48
|
| "why in the world the single quotations ' will kill the query."Because, as the error message infers, implicit conversion from Character String to Money is not supported.Kristen |
 |
|
|
|
|
|
|
|