DDH Software, LLC Making a big world smaller






Using Relationships Via Linked Fields

Author:Dave Haupert [Send Author Email]
Homepage:http://www.ddhsoftware.com
Date
Added:

May 02, 2013
Description:This database set is an example of how to bring over multiple fields from a parent table/database to a child using the relationship field. It's a set of databases called Actors and Movies. The main database is actors and there is a first name and last name for each actor. There is a link field to jump to the movies database to show all movies for that actor. The link/linked pair is set up to show the last name from the Actors databases in the Movies database. Normally this is enough to identify the parent record but in this case, the first name should also be shown in case there are two people with the same last name. So then there is a relationship field set up that uses the link/linked as a pair of matching values to grab the first name and show it. You'll see in the setup that the relationship is set to use the: Related Field in this database: Last Name (the linked field) Other Database Name: Actors Field in other database: Movies (the link field of the parent database) Show from other database: First Name (the field we wanted to show here) From Which Record: First matching record. (if the parent database had more than a single match, this setting would let you choose whether to take from the first or last matching record. In this case, there should only be one match since it's a one to many relationship and the 'many' (the movies db) is looking in the 'one' (the actors db) for a match. Thus, in the Movies database, you see both the first name (via the relationship) and the last name (via the Linked field type) for the parent record.
Has Data:Yes
Has Forms:No
Comments:To address topic in forum: http://www.ddhsoftware.com/forum/viewtopic.php?f=16&t=3066
Price:FREE
Version:HanDBase v.4.x Enhanced or greater
File:moviesactors.zip          Downloads: This Month 2271 / Total* 19306
Note:MAC Users will need to enter the filename moviesactors.zip when saving this file.
* since October 1, 2000.

Other Titles from Dave Haupert

11/27/2002 Orders [Phone-Calls/Sales-Tracking]
Order entry applet using multiple groups of DB popups.

11/05/2002 Addresses [Built-In App Replacements]
Like the Palm OS built-in Address book, with more flexibility!

11/05/2002 Patients [Medical]
Medical Patient Tracking Database

11/05/2002 Deliveries [Delivery Tracking]
Track your package/pizza/other deliveries!

05/17/2003 Checkbook (v3.0) [Financial]
Keep track of your checking account. Now updated for v3.0!

11/05/2002 Recipes [Food and Drink]
Database for keeping your cooking recipes handy!

11/05/2002 Journal [Miscellaneous]
Keep a journal or diary on your PalmPilot.

07/12/1999 Teacher's Aid [Teaching]
Starting point Database for keeping track of students.

11/27/2002 Time Log [Time Tracking]
Keep track of the projects you are working on.

07/23/1999 Cases [Law Enforcement]
Keep track of trials and cases with this Database. Could be useful for Attorneys, Judges, and law enforcement personnel.

07/28/1999 To-Do Multi [Built-In App Replacements]
To Do list which allows for related 'sub-items'. Can be used to make an outline-style To-do list.

07/24/2007 Gambling Winnings [Financial]
Keep track of your winning (or losses) at the Casino(s).

07/06/2009 Sell on eBay [Web Stuff]
Sell on eBay is an example database that goes with a tutorial in our support section. You can create this database from scratch by following along with the article here: http://www.ddhsoftware.com/knowledgebase.html?read=353 The database is designed for iPhone users of HanDBase in particular due to it's use of an external field type unique to the iPhone- taking a picture with the camera. This database can be used to track items you are selling or plan to sell on eBay. Many more fields can be added to track auctions, customer information, etc.

05/30/2011 EZ Shop [Food and Drink]
This database is included as a sample with many versions of HanDBase. It is a simple shopping list database.

02/24/2012 Month Calculator [Development]
This database was designed to demonstrate a way to figure out the month of a date field. The concept uses this idea: Take the date and do the following calculation: Date Mod 365.25 That will give you the number of days into the year. 365 days are in a year, but every fourth year is a leap year, so the .25 is added. Now you have a number from 0 to 365. To get the month, you'd have to do a series of conditionals. Something like this: If DateMod field (the calc field above) is greater than 31 then output is February, else January. If DateMod field is greater than 59 then output is March, else output is previous conditional. If DateMod field is greater than 90 then output is April, else output is previous conditional. ... The example has a date field where you can pick a date and then a conditional field that is visible showing the month of the year. A few caveats: 1. It uses up a bunch of hidden calculation and conditional fields. You'll need about 13 extra fields in your database to have room for this. 2. If you are in a leap year (such as now, 2012) the number in the conditional for February onward need to go up by one, as I did not account for the leap day in 2012. On other years, this should work fine as is. 3. September is one character too long for the conditional output, so I abbreviated as Sept You can then select a view to filter based on the month, so you can see all records that fall within the month you're looking at.

07/27/2012 Olympic Records [Sports]
This database was scraped from info on Wikipedia about the Olympic Records for various Summer Olympic games. It was taken from information right before the start of the 2012 Summer Games in London.

04/30/2013 Multi Day Elapsed [Automobiles]
This is a database demonstrating how you can calculate the elapsed time between a start and end time that could possibly span multiple days. Here's the explanation: Field 1: Start Date Field 2: Start Time Field 3: End Date Field 4: End Time Field 5: Days elapsed (Calc, output as Integer) = End Date - Start Date ---> Here we are subtracting to see how many days have passed Field 6: Seconds for Days (calc, output as integer) = (Field 5 - 1 )* 86400 ---> Here we are converting the above to seconds so it can be used with the time. Subtracting one since if the difference between a time one day and a time the next day is not 24 hours + the time, but just the time differences accounted for below. (Make sure to use parenthesis when setting up the formula. Field 7: Time to End 1st (calc, output as integer) 86400 - Start Time --> This is the number of hours from the start time to the end of that first day. Field 8: Total Elapsed Time (calc, output as time) Field 6 + Field 7 + Field 4 --> The trickiest part to understand here. This is adding the time until the end of the first day (field 7) plus the elapsed seconds for the days that spanned between them (field 6) plus the number of seconds into the last day (the end time, field 4). Field 9: In Hours (calc, output to 4 decimal places) Field 8 / 3600 --> The above was shown as a time which may be confusing when it's more than 24 hours, so this one calculates the total number of hours elapsed for billing type purposes.

02/07/2017 Unique Key Example [Automobiles]
This is a simple database designed to show you how to create a unique key field in HanDBase. One that can be seen and displayed in the database. This involves using the following: Link field- set to hidden and does not need to be set up to point to any other database. Conditional field- this is your unique Key and the formula is this: If Link field is zero, output is Link field, otherwise, output is Link field. As you can tell, the Conditional field will always evaluate to be the value of the link field, which is already a unique key, but normally one that is hidden.