×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

FoxPro Database Updates

FoxPro Database Updates

FoxPro Database Updates

(OP)
I have imported a file into Fox and am faced with several 8.0 numerics that I must convert to dates.  I've parsed the field and performed queries to build a table containing the date field in the format that I wish, but I've always had problems with the update queries.  How can I update "newfield" in table a with the corresponding date values from "converted_field" in table b where a.otherfield = b.otherfield and a.otherfield2 == b.otherfield2?
Is this simple enough to be done with a few select-update queries, or will I have to build a more complex .prg?

RE: FoxPro Database Updates

Suggest you create an index on otherfield+otherfield2 for
b.DBF
USE a.dbf IN 1 ALIAS adbf
USE b.dbf ORDER nyNewIndex IN 2 ALIAS bdbf
SELECT adbf
SET RELATION TO otherfield+otherfield2 IN bdbf
REPLACE ALL newField WITH bDbf.whateverField


Hope this helps

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: FoxPro Database Updates

OR:

SELECT <TableB>
INDEX ON OtherField + OtherField2 TAG PKey

UPDATE <TableA> ;
  SET <TableA>.NewField = <TableB>.Converted_Field ;
  WHERE INDEXSEEK(<TableA>.OtherField + <TableA>.OtherField2, .T., <TableB>, "PKey")

*** Table B is still selected
DELETE TAG PKey  && this is optional

Regards,
Thom C.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close