SQL money update problem

Results 1 to 4 of 4

Thread: SQL money update problem

  1. #1
    santos Guest

    Default SQL money update problem

    this is extremely urgent, could you please reply to me as soon as you can if you have any ideas.<BR>i have the SQL DB (called main) with the money-field called account, i want to add the value to the fields from the numeric variable:<BR><BR>m_curr = CCur(m_all)<BR>strQuery = "UPDATE main SET account = " & m_curr<BR>Set db3 = Cnn.Execute(strQuery)<BR><BR>this is suppossed to work, but it does not, it gives an error saying something that i have to convert the variable and that there is an error in the strQuery line. anybody has any idias? or maybe another code that i could use for the same purpose? please, help.

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL money update problem

    If all it needs is for you to convert the value, SQL does have a Convert function that allows you to get around annoying little problems like this. Change your query to:<BR><BR>strQuery = "UPDATE main SET account = CONVERT(money, " & m_curr & ")"<BR><BR>That should get you around this problem<BR>

  3. #3
    santos Guest

    Default RE: SQL money update problem

    thanks a lot, i hope this works, i will check it out right now.<BR><BR>thanks again.

  4. #4
    santos Guest

    Default RE: SQL money update problem

    this works, but when it adds the number to the DB, it rounds it for some reason. for example, when m_curr = 8.7 , in the DB it adds only 8.<BR><BR>any ideas how to fix this please?

Posting Permissions

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