Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    9

    Unanswered: match columns and replace according to match..

    Hey all,

    I used to work with Microsoft Foxpro 6 regularly but now I haven't touched it in months and forgot the proper syntax

    I have two databases, they're both the same except that one is outdated. I'd like to match the outdated one up to the good one by product code, and replace all product weights with the newer weight, when the codes match.

    foxpro is giving me hell about it though, here's the command I'm trying to execute

    ---------------------

    repla all prods428.product_we with prods.product_we where prods428.product_co = prods.product_co

    --------------------------------------------

    in english, replace all old products weight with new products weight, where old products code equals the new product code..

    Any help? I'm sure it's just a minor syntax thing. Thanks in advance

  2. #2
    Join Date
    May 2004
    Location
    Redwood Shores, CA
    Posts
    68
    Quote Originally Posted by Mike521
    Hey all,
    ---------------------
    repla all prods428.product_we with prods.product_we where prods428.product_co = prods.product_co
    --------------------------------------------

    in english, replace all old products weight with new products weight, where old products code equals the new product code..

    Any help? I'm sure it's just a minor syntax thing. Thanks in advance
    Now I am not a foxpro guru but I have a hunch that you may want to say repace instead of repla. How's that?
    My way or the highway. Yeah

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd suggest that you start with the REPLACE documentation. Your example looks like you are combining the syntax for REPLACE with SQL syntax, and that VFP is having trouble sorting out what you meant!

    -PatP

Posting Permissions

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