Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102

    Unanswered: convert data to currency

    I have a column - datatype 'money' and my price variable is (for instance)
    8450
    how do I put this value into the money column without getting this error?

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    [Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion from data type varchar to data type money, table 'db196009544.dbo196009544.vehicles', column 'price'. Use the CONVERT function to run this query.
    ASP VBScript
    I am using this syntax:

    Code:
    price = Upload.Form("price") '---this gives 8450---
    
    SQL="UPDATE vehicles SET price='" & price & "' WHERE id=" & request.queryString("linkID") & ""
    Thanks
    mark

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Do you define the variable as a daatype...sounds like it's defined as char if you are
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102
    not sure!
    I have tried using cCur() and various others when estting the variables but to no avail.

    I suspect it has to be done in the SQL string, but can't make that work either.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I mean it lloks like vb, and I'd ratyher keep my hands clean, buit can you do?

    price = Upload.Form(price)

    Also, you'd be way better off using stored procedures
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102
    removing the single quotes from the price variable apears to have solved that but now the datetime variable is playing up in the same fashion, so I can't be sure if all is well with the price.
    see my next post!

Posting Permissions

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