Turansky Posted January 18, 2002 Posted January 18, 2002 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 ]
Garry Claridge Posted January 18, 2002 Posted January 18, 2002 You can use: [FMP-Record] [FMP-If: myfield .neq.] Display fields from record [/FMP-If] [/FMP-Record] Hope this helps. Garry
The Bridge Posted January 18, 2002 Posted January 18, 2002 Another option: Make your original link something like: -db=SchoolsMaster.fp5&-lay=formview&-sortfield=school&-sortorder=ascend&-max=all&-Op=eq&Fieldname=&-find
Turansky Posted January 18, 2002 Author Posted January 18, 2002 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 ]
The Bridge Posted January 18, 2002 Posted January 18, 2002 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.
Turansky Posted January 18, 2002 Author Posted January 18, 2002 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
Garry Claridge Posted January 18, 2002 Posted January 18, 2002 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
Recommended Posts
This topic is 8414 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