Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    1

    Unanswered: Replace inside field in DBF database

    Hi everyone!

    I'm having a little trouble to input some data in my sql server database because the source files that are a DBF database that are formatted diferently in some numeric fileds. The fields contain values like 34,5 and 56,7. I need to replace these "," for "." so I don't mess up the insert on sql. I cannot do this with de code in VB (my system is in VB6 by the way) because I'm building the insert statement inside the select of the DBF. something like this.

    rsdbf.open " select 'insert into table1 (campo1, campo2) values('+campo1+','+campo2)"

    I need something like select 'insert into table1 (campo1, campo2) values('+replace(campo1,",",".")+','+campo2)

    Thanks in advance

    PS: Sorry about some gramatical errors, my english is not that good.

  2. #2
    Join Date
    Nov 2002
    Posts
    128
    Provided Answers: 1
    First question: When you say that the DBF field contents are like - 34,5
    How are you viewing that data?
    Are you using the 'native' environment for the DBF data table or something else?

    If the DBF environment is somehow set to European, where commas and decimal places are interchanged within numbers, the value may APPEAR like that, but in reality not BE that.

    Or if the DBF data table field was a Character field instead of a Numeric field then it could have a comma instead of a decimal place. If this were the situation, it is easy to change with a Character or String substitution.

    With some clarification we can assist you better.

    Good Luck

Posting Permissions

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