Daniel Shanahan Posted July 26, 2007 Posted July 26, 2007 Is it possible to select records based on multiples of a particular number? I want to use this in a Case statement. I currently have Case (Subject_ID = 3 or 8 or 13 or 23 or 28; "Mathematics") This works fine. I am just wondering if I can shorten it a bit. What I'd like to do is say "Find every multiple of 5 beginning at 3 and ending at 28." Also, would such a function work with an "or" statement? I want "Mathematics" to appear only if one of the multiples of is true. Thanks. dan
comment Posted July 26, 2007 Posted July 26, 2007 I currently have Case (Subject_ID = 3 or 8 or 13 or 23 or 28; "Mathematics") This works fine. I doubt it. This would ALWAYS return "Mathematics". "Find every multiple of 5 beginning at 3 and ending at 28." You could try: Case ( not Mod ( Subject_ID - 3 ; 5 ) ; "Mathematics" ) Or, if the 'ending at 28' condition is significant: Case ( not Mod ( Subject_ID - 3 ; 5 ) and Subject_ID < 29 ; "Mathematics" ) I want "Mathematics" to appear only if one of the multiples of is true. I didn't get this part.
The Shadow Posted July 26, 2007 Posted July 26, 2007 (edited) Mod() can find multiples of 5: Case( Subject_ID >= 3 and Subject_ID <= 28 and Mod(Subject_ID-3, 5) = 0; "Mathematics" ) I'm not sure what you mean by "one" of the multiples, is Subject_ID a multi-key value? I see my post is an exact duplicate.... :) Edited July 26, 2007 by Guest
Daniel Shanahan Posted July 26, 2007 Author Posted July 26, 2007 Thanks for the responses. I was trying to create a "work-around." I have a series of hierarchical portals and I was trying to "dump" information into a field and then have that field accessible via a portal on another page. See the attached file. Also, see my related post Topic#188726. Thanks. dan TeacherDB.fp7.zip
Daniel Shanahan Posted July 27, 2007 Author Posted July 27, 2007 Can anyone shed some light on why the portal fields "bounce" back to the first portal record? - dan.
The Shadow Posted July 28, 2007 Posted July 28, 2007 I took a look at your file. Unfortunately, portals are not quite that flexible. If I have a chain of relationships, with A being the table the layout is based on: A - B - C - D - E - F You can create a portal for table D to put on this layout, and it will show all related records from D. You can also drop fields from B and C into the portal, and they will be the correctly corresponding values for each D record. But, putting a field from E or F into the portal will only show the first value (for the D record you're looking at). This is similar to how dropping a field for D on the A layout will only show the first value. Basically, a portal based on table D will have one row for each related record in D, you'll never get any more than that. Hope this helps.
Daniel Shanahan Posted July 28, 2007 Author Posted July 28, 2007 Thanks Shadow. It helps to know that I could not make this work because it was not intended to work that way (hope that makes sense). Thanks for the reply.
Recommended Posts
This topic is 6388 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