Jump to content

Self Join/ Find not working on networked DB's


elgordon
 Share

This topic is 6493 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Help, I know there must be a simple solution. I have two DB's (JobBook and timetracker) with a one to many relationship based on a Job# field.

I am trying perform a find on the related field Job# using the active record from JobBook. I have tried using both a Copy and Paste scenario and a self join scenario..

Scenario 1 (just a description, not exact syntax)

in JobBook

- Copy Job# from active JobBook record

- Run external script (timetracker, Find)

in timetracker, Find script

- Paste into a global field (Job# copy)

- Enter Find mode and Set Field (Job#, Job# copy)

- Perform Find

Scenario 2 (also just a description, not exact syntax)

in JobBook

- Run external script (timetracker, selfjoin)

in timetracker, selfjoin script based on selfjoin relationship using Job# as the key

- Show All Records

- Go To Related Record (show, "selfjoin")

Both work on my machine locally but fail when I try and use the same technique on networked files. I've tried everything I can think of and think I'm going a bit crazy. When it runs on the networked files, it finds the wrong info...the self join finds completely unrelated records (the same one over and over actually)...any words of wisdom??

Addition to the original post - I've posted examples of the files. Now, they're not working locally either... I thought about it a bit and what I'm really trying to arrive at is a summary of the timed sessions shown in the portal. Although I'm new enough to this that I haven't figured out how to do that either. Thanks for your advice.

FileMaker Version: 6

Platform: Mac OS X Jaguar

timetracker_test.zip

Link to comment
Share on other sites

Your self-join won't work because you're only showing records in the timetracker file based upon whatever record you happen to be on in that file at the time, which is independent of the record you're on in JobBook.

Your copy/paste could work, but is more convoluted than necessary.

You're setting the time summary based upon the first related record in the timetracker file, not all of them, and you're trying to use a summary field in that file to set a field in JobBook, which isn't going to work.

I think you could reduce the entire script to a single step:

Set Field[time summary, Sum( timetracker log::Total Time Entered for session )]

This will set time summary with the total of all related 'Total Time Entered for session' fields for the currently viewed Job. No need to do a find in the related file, since the 'timetracker log' relationship is already defined by Job#.

Link to comment
Share on other sites

This topic is 6493 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.