January 18, 200223 yr I have a database with a 1000 records and get the results fine and dandy but would like to exclude the records that have a blank or empty value in a particular field. How do I do that? Or maybe my question is is there a way to check if a value is present? -db=SchoolsMaster.fp5, -lay=formview, -sortfield=school, -sortorder=accend, -max=all,-findall I think the -op== command is used but don't understand how to format this. Thank you Kent [ January 17, 2002: Message edited by: Turansky ]
January 18, 200223 yr You can use: [FMP-Record] [FMP-If: myfield .neq.] Display fields from record [/FMP-If] [/FMP-Record] Hope this helps. Garry
January 18, 200223 yr Another option: Make your original link something like: -db=SchoolsMaster.fp5&-lay=formview&-sortfield=school&-sortorder=ascend&-max=all&-Op=eq&Fieldname=&-find
January 18, 200223 yr Author Garry, It worked perfect. Thank you ------------------------------------------- The Bridge, I tried what you said but that did not work. Let me also point out that I didn't fully explain what I was doing. If I could do it your way it might be less code for me. Which I always like. Thank you This is what works now for me: <select name="school" size="10"> [FMP-InlineAction: -db=Schools Master.fp5, -lay=form view, -sortfield=school, -sortorder=accend, -max=all,-findall] [FMP-Record][FMP-If: school .neq.]<OPTION VALUE=[FMP-field: school]>[FMP-field: school][/FMP-If] [/FMP-Record] [/FMP-InlineAction] </select> [ January 18, 2002: Message edited by: Turansky ]
January 18, 200223 yr Whoops... the problem was with me, not you. In my example, I used -Op=eq; it should be -Op=neq. Here are the values the -Op tag accepts: eq - equals cn - contains bw - begins with ew - ends with gt - greater than gte - greater than or equal to lt - less than lte - less than or equal to neq - not equal to I notice you have -SortOrder=accend. This should be -SortOrder=ascend. Also, I'd recommend designing your databases with underscores in the names of fields and layouts instead of spaces. Having said all that, your best bet may be to go with Garry's solution, since it actually works for you.
January 18, 200223 yr Author Hello The Bridge, I gave that a try but still no success - it's still spitting out blank fields before it gets to the actual fields that have data. Any other solutions? [FMP-InlineAction: -db=Schools_Master.fp5, -Op=neq, school=, -lay=form_view, -sortfield=School, -sortorder=ascend, -max=all, -findall] Thank you Kent
January 18, 200223 yr With the method by The Bridge, try -find not -findall; e.g: [FMP-InlineAction: -db=Schools_Master.fp5, -Op=neq, school=, -lay=form_view, -sortfield=School, -sortorder=ascend, -max=all, -find] A few ways to "skin-a-cat". All the best. Garry
Create an account or sign in to comment