|
Your continued generosity and support of FMForums is greatly appreciated. |
merkaba22
master
Posts: 342
Loc: Hollywood, CA
Post Rank (AVG):
FMP: 10 OS: Mac OS X Snow Leopard Skill: Advance
Tweet This Post!
|
I know how to create a relationship by date fields in the parent and child tables, but am unclear on how to create a relationship based on a calc for a date range, ie the way the calc would be written -- I think globals would be involved.
I wonder if there are any readably apparent calcs I could use?
Thanks in advance:)
"We are the ones we have been waiting for!”
"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.
Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain
"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."
"Like the Maya, we shall understand that the path to the stars is through the senses."
"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".
"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."
|
|
|
|
merkaba22
master
Posts: 342
Loc: Hollywood, CA
Post Rank (AVG):
FMP: 10 OS: Mac OS X Snow Leopard Skill: Advance
Tweet This Post!
|
In response to merkaba22
In followup, I suppose I could create a global wherein the user types in the field the values comprising two dates seperated by three periods, Date1 ... Date2, to cover a range of dates and build the relationship on that pre-existing FM find feature, but wonder if there is a better way these days?
"We are the ones we have been waiting for!”
"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.
Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain
"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."
"Like the Maya, we shall understand that the path to the stars is through the senses."
"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".
"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."
|
|
Andy H
newbie
Posts: 5
Post Rank (AVG):
FMP: 10 Advanced OS: Mac OS X Leopard Skill: Intermediate
Tweet This Post!
|
This is Andy H's fifth post.
In response to merkaba22
Hi,
Try looking at the below post. I think that should point you in the right direction:
http://fmforums.com/forum/showtopic.php?tid/209693/post/333941
|
merkaba22
master
Posts: 342
Loc: Hollywood, CA
Post Rank (AVG):
FMP: 10 OS: Mac OS X Snow Leopard Skill: Advance
Tweet This Post!
|
In response to Andy H
In other examples I can create a key field based on a calc for the portalID&date which will return all the records for this combination, for example:
I specify portalID as "1" related to the parent file via parentID defined also as "1", the relationship becomes dynamic based on the date entered into "date" and shows all records for that specific date in the portal.
I am looking for a daterange_calc definition that provides a range of dates that the user can select, say date1 and date2, such that all the records for the dates within the range between date1 and date2 will be shown in the portal.
Thank you in advance.
"We are the ones we have been waiting for!”
"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.
Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain
"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."
"Like the Maya, we shall understand that the path to the stars is through the senses."
"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".
"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."
|
Edited by merkaba22 on 03-10-10 05:42 PM. Reason for edit: No reason given.
|
IdealData
IdealData
Posts: 2102
Loc: UK
Post Rank (AVG):
FMP: 9 Advanced OS: Mac OS X Tiger Skill: Advance
Tweet This Post!
|
In response to merkaba22
In the parent table you will need 2 globals and set up the relationship like this
gStartDate <= PortalDate
gEndDate >= PortalDate
Ideal Data - Coherent systems for a chaotic world
I'm available for hire, e-mail me |
|
Ocean West
I have an idea!
Posts: 3593

Loc: Escondido, CA USA
Post Rank (AVG):
FMP: 11 Advanced OS: Mac OS X Snow Leopard
Member: TechNet, FBA Skill: Expert
Certified:
FMPug
Tweet This Post!
|
In response to IdealData
Another option...
I have 1 global / 1 relationship
and 2 custom functions in my solution along with a script
I am using MagicDates ( ) and CustomList ( )
Note: in this solution the Custom List is renamed to list.custom
|
|
Your continued generosity and support of FMForums is greatly appreciated. |
merkaba22
master
Posts: 342
Loc: Hollywood, CA
Post Rank (AVG):
FMP: 10 OS: Mac OS X Snow Leopard Skill: Advance
Tweet This Post!
|
In response to IdealData
Ideal Data!
This worked perfectly for the application and I wonder if there is a way to expand:
gStartDate <= PortalDate
gEndDate >= PortalDate
I added in another global variable field to the parent, say, "Location" and a calc field, c = Location:
(Case(IsEmpty(Location= 1); ""; Location))
Added to the definition of the relationship:
gStartDate <= PortalDate
gEndDate >= PortalDate
gLocation_calc = Location
And this works but when I do not give a value to "Location", there are no records shown in the portal at all -- is there a way to modify this so that all records are returned and that when a value is assigned it filters accordingly?
The idea being I could then offer more variables, like "service" to further filter the display in the portal.
Thanks again!
"We are the ones we have been waiting for!”
"We owe a lot to the Indians (from India), who taught us how to count, without which no worthwhile scientific discovery could have been made." - Albert Einstein.
Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do ... Explore. Dream. Discover'. Mark Twain
"Someday," Neil Young said, "the digital age will be seen as the Dark Ages of recorded sound."
"Like the Maya, we shall understand that the path to the stars is through the senses."
"Dream big -- because no matter how big that is, it's nothing compared to what you really can do".
"Using the most reliable approach for bending reality to your desires, imagination is always the key first ingredient, then by adding clear intention, expectation and action, results will be realized."
|
|
|
|
|