Converting data type varchar to data type money

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Converting data type varchar to data type money

    Hi all,

    Tearing my hair out trying to figure this out. If anyone can provide any help
    i would greatly appreciate it. When I try to do an insert into my MS SQL
    Database, keep getting following error....

    [Macromedia][SQLServer JDBC Driver][SQLServer]Disallowed implicit conversion
    from data type varchar to data type money, table
    '05NeoCon.dbo.RegistrationT', column 'AmtPaid'. Use the
    CONVERT function to run this query.

    The error occurred in D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line
    21
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 9
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 7
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 1
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 21
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 9
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 7
    Called from D:\mmpi\showreg\neoconseminar\scout\insertdata.cfm : line 1

    19 : '<cfloop from="1" to="#arrayLen(session.semcart)#"
    index="i">#DollarFormat('#session.semcart.ActCost# ')##chr(13)##chr(10)#</cfloop>
    ',
    20 : '<cfloop from="1" to="#arrayLen(session.semcart)#"
    index="i">#rtrim('#session.semcart.ActTime#')##chr (13)##chr(10)#</cfloop>',
    21 :
    #DollarFormat('#session.totalprice#')#,'#session.S pamPhone#','#session.SpamFax#'
    ,'#session.SpamEmail#','#session.SpamMail#','#sess ion.Spam3rdParty#');
    22 : </cfquery>
    23 :


    First off, can someone please explain why i'm getting this error? And also,
    can you please tell me how I would convert #session.totalprice# from data type
    varchar to data type money in order to make SQL happy? Thanks in advance for
    your help.

    Salman

    schaudry Guest

  2. Similar Questions and Discussions

    1. Converting from data type varchar to data type money
      Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert...
    2. HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type
      I have the following problem: I have the following form client side: <FORM.......> <FORM action="./WZUpload.asp" method="Post"...
    3. HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type ?
      I have the following problem: I have the following form client side: <FORM.......> <FORM action="./WZUpload.asp" method="Post"...
    4. <<Error converting data type char to smalldatetime>>
      Hi All (IIS 5, SQL 2k, Win 2k) I'm stumped and can't find where I would be "mis-converting" data. I receive the following error ONLY when I update...
    5. Converting Strings to SmallMoney Data Type
      I'm trying to convert a string to a money(or smallmoney) data type. The original string from the data source looks like this: -00000010232 (this...
  3. #2

    Default Re: Converting data type varchar to data type money

    Instead of dollarformat() (which I think inserts the $ symbol before the price)
    have you tried LSCurrencyFormat( session.totalprice, "none" ) instead? This
    will convert the total price into the 0.00 formatted datatype I guess you're
    looking for.

    Phil

    Fychan66 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139