Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Help! - Correcting related DB & adding a SUM field


ekz

Recommended Posts

Please help, I'm an experienced SQL DBA/Web developer but

absolutely clueless in FileMaker, and of course I have a

tight deadline on the project! :

 

I need some direction on the following two issues:

1) I have the task of correcting data in a related table--

In Contacts, I have fields OldID and NewID. My Donations

table is linked to the Contacts table via

Donations:ContactID Contacts::OldID. Now I want to

achieve the following:

 

For each record in Contacts,

- Use oldID to find the related record in Donations,

- Update Donations:ContactID to Contacts:NewID"

 

In SQL i'd do an update query, but dont know how to do it in

FMaker!

 

2) I need to create a field in one of my Contact layouts

that reflects the total of all that contact's donations;

basically a sum of related fields in the donations table. I

found out how to do calculated fields, and use SUM, but i

dont know how to apply it to a situation when there are a

dynamic number of fields/ records to be added

 

Any help would be appreciated, thanks in advance!

 

[ ikamanu@gmail.com ]

Link to comment
Share on other sites

Hi.

 

1)

If I understand correctly, a lookup will do the job. Make "FieldToUpdate" a lookup field through the relationship ContactID. If this is once-off then do the lookup manually:

1- make sure you've got a found set of all records to update

2- put the cursor in ContactID field of one of the records

3- go to menu bar ->records -> lookup records

 

the above can be scripted.

 

 

2) calculation:

 

sum(contactID::donations) should reflect the total per contact if "contactID" is the relationship field (and its name), you're on the right track there.

see the sample in post #7 in this thread (thread is about portal filtering but sample shows sum function also. )

 

 

 

let me know if you need further help.

 

kjoe

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use