graemeaustin Posted February 8, 2002 Posted February 8, 2002 I've read all the existing posts on finding and have checked out the FM help site too but still no joy .... So could someone help me please: I want to be able to do a find in CDML to achieve the following: (fieldA = X and fieldB = Y) or (fieldC = X and fieldB = Y) Needless to say the real world problem has 6+ fields to search through but the principle must be the same. I can't figure out what to do with -op, -lop and exact match searches (if indeed these are part of the solution). Any help is gratefully appreciated. Graeme
graemeaustin Posted February 8, 2002 Author Posted February 8, 2002 I've just had a thought. Can anyone tell me if this might be right: Do an exact match with fieldB = Z <input type=hidden name=fieldB value="=="> <input type=hidden name=fieldB value="Z"> Then do <input type=hidden name =-lop value=or> <input type=hidden name=fieldA value=X> <input type=hidden name=fieldC value=X> Desperately trying to understand... Graeme [ February 08, 2002, 04:48 AM: Message edited by: graemeaustin ]
graemeaustin Posted February 8, 2002 Author Posted February 8, 2002 My suggestion did not work. Anyone got any better ideas?
Keith M. Davie Posted February 8, 2002 Posted February 8, 2002 Let;s start with the exact match you propose: <input type="hidden" name="fieldB" value="=="> <input type="hidden" name="fieldB" value="Z"> First, note the additional quote marks. Get used to including them in this way. It will save you some trouble. This code assumes that you are hard-coding value Z and do not want the client to make any input choices. If you wanted the client to make the input choices you would write: <input type="hidden" name="fieldB" value="=="> <input type="text" name="fieldB" value=""> ---------- However using your hard-code choice (and assuming that you have all the required tags) I would start with an exact search of two fields: <input type="hidden" name="fieldA" value="=="> <input type="hidden" name="fieldA" value="X"> <input type="hidden" name="fieldB" value="=="> <input type="hidden" name="fieldB" value="Z"> Then on your results format use an If conditional such that if records are found display the results else display the next set of search criteria. With some creative coding you may also be able to set the If conditional such that found records are displayed and the next set of search criteria is displayed and is coded such that the found records are included in the next result. Or you could do an exact search of all six fields at once. I am reluctant to use the or with a logical operator. I think you will have real problems with that. HTH [ February 08, 2002, 05:51 AM: Message edited by: Keith M. Davie ]
graemeaustin Posted February 8, 2002 Author Posted February 8, 2002 Thanks very much Keith - I'll try your suggestion: it certainly makes a lot of sense (I couldn't see how to use the or operator correctly!) Graeme
Garry Claridge Posted February 8, 2002 Posted February 8, 2002 Certainly Keith's suggestion of combinding the search with [FMP-If][FMP-Else] statements is what I would try first. However, you may also consider the use of a calculated field to construct the logic and report a condition of "True" or "False". Then, do a CDML search on that result. A couple of ways to skin a cat. Garry [ February 08, 2002, 12:29 PM: Message edited by: Garry Claridge ]
Recommended Posts
This topic is 8421 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