denno Posted September 7, 2007 Posted September 7, 2007 I am trying to figure out how to auto-enter a date that's a week later than the previous record & found this to use as an example: http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000333 I don't understand the relationship in the file, though. There is only 1 table; how was the "Previous Record" table created? Also, what is the difference between --< and >--< thanks!
BobWeaver Posted September 8, 2007 Posted September 8, 2007 There is no previous record table. This is a type of self-join relationship because it relates within the same table. The 'serial' field is set up to autoenter a sequential serial number, and the 'previous serial' field is set up to autoenter the value of the serial field minus one. Hence the 'previous serial' field will contain the same number as the 'serial' field in the previous record. So, if you create a relationship between the 'previous serial' field, and the 'serial' field, it will link all records to their immediately preceding record so that you can extract the data from it. To create a this type of relationship, go to the Relationships section of the Define Database window, and drag from the 'previous serial' field out of the table and then back into the table to the 'serial' field. Filemaker will automatically create a second TO (table occurrence) for you (and will come up with a default name which you can edit). Then, it's just a matter of setting the autoenter formula for your date field. The formula to add a week to the previous date would be something like: Date = MyTable_2::Date + 7 Where MyTable_2 is the name of the second table occurrence.
Recommended Posts
This topic is 6343 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 accountSign in
Already have an account? Sign in here.
Sign In Now