Solved

How to return unique values from XML Custom Web Publishing...???

Posted on 2006-10-23
6
251 Views
Last Modified: 2010-04-27
I'm using the following call to return email addresses from our database based on buyers of a certain product in our database:

https://server.com/fmi/xml/fmresultset.xml?-db=Invoices&-lay=waGetEmails&-sortfield.1=Leads_Clients::Email_Address&Invoice_Items::Description="&ProductDescription&"&-find

This returns results just fine, however, if the same person bought the same type of item more than once their email is getting returned multiple times.

How can I filter this so that it only returns unique values?  Basically, I  need the equivalent of a SQL SELECT DISTINCT statement.

Any information would be greatly appreciated.  thanks!
0
Comment
Question by:Andrew Angell
  • 2
  • 2
6 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 17792896
you should issue the query to the customers table, not the invoices. this assumes you have a link in between the customers and the invoice_items table, which you may not have
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 17793061
I don't see what that would help...???  The criteria I'm searching on is in Invoice_Items.  The data that I'm actually returning is in Leads_Clients (customers).  These are related based on an invoice.  Invoices::ID relates to Invoice_Items::ID and Leads_Clients::ID relates to Invoices::CustomerID.  That's the whole point of a relational database, isn't it?  If I have to keep creating relationships everything then I'm confused.

Also, would that even help my problem?  If just select from the Invoice_Items with a relationship between the 2, say Leads_Clients::CustomerID and Invoice_Items::CustomerID, I'd still get an email address back for every item in Invoice_Items where there was a match.  Which would still be multiple.

You've kinda gotten me all twisted here.  I'm a little lost.
0
 
LVL 28

Expert Comment

by:lesouef
ID: 17795196
I was just trying to find a way to get a single record as the result, and I only see the client table to do this. Ignore my idea if it confuses you. I am always thinking what I would do with a regular FM client, I am not using theses web things as it makes everything more difficult.
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 17800328
I got it to work by creating a recordset and adding each email to it within the parsing loop.  Then I can use sorting and only print emails that aren't equal to each other.  
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18023850
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question