April 16, 200421 yr Newbies Hello, I cannot figure out how to compose a particular FM query in a URL. Suppose I have a database of names and addresses. I want to find all the "Smith's" that live in NY or NJ, but not any other states. A SQL-esque query might look like this: SELCT * FROM mydatabase WHERE lastname=smith AND (state=ny OR state=nj) The FM query I am trying to use looks like this: http://myserver.com/fmpro? [snipped...] &name=smith&state=NY&state=NJ&-find If I insert "-lop=and" anywhere in the query, I get NO records found because there are no records that have both NJ and NY as the state. If I include "-lop=or," I get nearly all the records that contain "smith" from any state. I'm thinking that what I want to do isn't possible in FM with custom web publishing, because the logical operator (-lop) seems like it must apply to the entire query (all values are joined as AND or OR, but not some with AND and others with OR). Thanks! FileMaker Version: 6 Platform: Windows 2000
April 16, 200421 yr This has been answered. Look in the Sample Files forum for the demonstration CDML -LOP values There is also a demonstration on the CDML -op values and symbols which you may or may not find useful. It is written in Pro5.x. You will need to drag and drop.
April 16, 200421 yr Author Newbies Unable - thanks for your reply; I have searched and searched and not found the answer in the forums. The sample files for -LOP and -op do not address this issue; this thread poses my question exactly: http://www.fmforums.com/threads/showflat.php?Cat=0&Board=UBB22&Number=20849&Forum=c9&Words=%2Brefine&Searchpage=0&Limit=500&Main=20842&Search=true&where=bodysub&Name=&daterange=1&newerval=5&newertype=y&olderval=&oldertype=&bodyprev=#Post20849 The issue of selecting a range of values is addressed, but not the issue of performing one find that returns records that have either of two values for a particular field, while excluding records that have all other values for that field. I'm looking for the web companion equivlent of adding multiple find requests. In my original example, the first request would be name=smith, state=ny, and the second would be name=smith, state=nj.
April 16, 200421 yr CDML is a limited in regards to this. However, the work around is to use [FMP-If] tags and Tokens in the Format file. For example: http://myserver.com/fmpro? [snipped...] &-Token=smith&-lop=or&state=NY&state=NJ&-find In the Format file use: [FMP-Record] [FMP-If:CurrentToken.eq.Field:name] html goes here [/FMP-If] [/FMP-Record] Good Luck Garry
Create an account or sign in to comment