Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Distinct function?

Distinct function?

Distinct function?

In the SQL world I can run write a query with a DISTINCT argument to aggregate values in a particular column.  Does FMP have a similar function?  I need to be able to set all the possible values in any given field into a global field.

I know it's possible to export values from a field once they been sorted and summarized, but I need the values to be available within the application (not in an exported file).

Can this be done recursively through a custom function?  Any idea on what it would look like (or is that overkill?)

RE: Distinct function?

As far as I can see, and not knowing the why, you need to script it.

See how far you can go with Get(ActiveFieldContents) and a set field script in a loop.

RE: Distinct function?

On the other hand, if you want a Custom Function, I would look at the new GetNthRecord() function in FM8, if you have 8A.

You could make something along these lines:

Case ( currentRecordNumber < Get ( FoundCount );
               GetNthRecord ( yourField ; currentRecordNumber )
                    & ΒΆ & CFName( yourField; currentRecordNumber + 1 );
          currentRecordNumber = Get( FoundCount );
               GetNthRecord ( yourField ; currentRecordNumber )

Within this function you only need the value from yourField and currentRecordNumber


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close