André Posted July 10, 2009 Posted July 10, 2009 Hi, i hope someone can help me with this, i'm trying to make a portal with a range between two timestamps my records all have a date and time field i made a selection box 'select', with '1' as the value for a [X] a calculation 'Timestamp_selected' > If(select;Timestamp ( Datum ; Start );"") resulting in a timestamp when the record is selected. now, i'd like to select two records (by putting a 1 in the 'select' field) and see all records between the two calculated timestamps in a portal. i tried this with three more calculations; > the calculationfield 'one' = 1 for a relationship called 'one': one=one (resulting in a relationship with all other records) then two more >timestamp_from MIN(one::Timestamp_selected) >timestamp_to MAX(one::Timestamp_selected) resulting in a relationship based those two; timestamp ≥ timestamp_from AND timestamp ≤ timestamp_to unfortunately FileMaker doesn't accept those, because they refer to a relationship... Any suggestions how to tacle this?
bcooney Posted July 10, 2009 Posted July 10, 2009 (edited) This really confuses me: "now, i'd like to select two records (by putting a 1 in the 'select' field) and see all records between the two calculated timestamps in a portal." How are you selecting two records? A portal is a relationship btw one parent record and its children. What is the parent record? Why a portal? Why not just find for a date range in the child table? PS: Welcome to the Forum Edited July 10, 2009 by Guest
comment Posted July 10, 2009 Posted July 10, 2009 I think all you need is a calculation field cTimestamp in the data table (result is Timestamp) = Timestamp ( Datum ; Start ) Then make the relationship: TO::timestamp_from ≤ Data::cTimestamp AND TO::timestamp_to ≥ Data::cTimestamp
André Posted July 12, 2009 Author Posted July 12, 2009 (edited) Thanks for your quick reply, i found another way to show the range, i'll include a example file, comments are welcome. example_daterange.fp7.zip Edited July 12, 2009 by Guest
comment Posted July 12, 2009 Posted July 12, 2009 Your method will not allow each user to view their own range.
comment Posted July 12, 2009 Posted July 12, 2009 Here's something very similar - only simpler. example.fp7.zip
bcooney Posted July 12, 2009 Posted July 12, 2009 Nice, comment, but where's the portal? The OP mentioned selecting two records to determine start and end and then showing all records that fall between start and end in a portal. That's why I didn't reply with a demo like this.
comment Posted July 12, 2009 Posted July 12, 2009 I addressed the portal issue in my first reply. It's up to Andre to explain how users could select the records, when the portal itself shows the RESULT of such selection.
bcooney Posted July 12, 2009 Posted July 12, 2009 It didn't seem to me that he understood that there's one parent for a portal. It really seemed as if he was trying to filter a portal based on selecting two parents. Certainly, the use of global fields for the filter didn't occur to him. And, in the end, your demo doesn't even have a portal. Whatever.
André Posted July 12, 2009 Author Posted July 12, 2009 Thank you.. it's much simpler that way nice trick with the background, and the shift-click was new for me too bcooney: i discarded the portal idea, because this worked for me just as fine :smirk:
Recommended Posts
This topic is 5759 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