www.webdeveloper.com
Results 1 to 2 of 2

Thread: string to currency

  1. #1
    Join Date
    Jun 2007
    Posts
    15

    string to currency

    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")) & "' "

    [green]'Session("plusMillion") is equal to 1000000[/green]

    this 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

  2. #2
    Join Date
    Jul 2004
    Posts
    300
    try this:

    SELECT STotalAllocation FROM tabletoquery where STotalAllocation >= " & CCur(Session("plusMillion"))

    I believe the problem is that you have single quotes around the value.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles