New call-to-action
Results 1 to 13 of 13

Thread: Filtering Letters/Labels for Unique Records

  1. #1
    Chris Shinnick
    Guest

    Default Filtering Letters/Labels for Unique Records

    I have created an envelope that prints addresses based on a query of marked records. In the table several records that have an identical value in the NAME field may be marked.

    When I attempt to query the records using an operation that sorts by Name, queries the marked records, and checks that each record is unique, the query comes back correct. However when I print the envelopes (basing the order and filter on the current selection of records), I end up with multiple copies of the same envelope.

    If I set the envelopes to Prompt for Criteria at Print time, I can check the box next to Unique Records, and everything will print correctly without duplicate envelopes.

    I really just want to set a filter parameter to force it to use unique records that are marked.

  2. #2
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Filtering Letters/Labels for Unique Records

    when you say "the query comes back correct", if you display a browse of the results of the query, do you see only one instance of each name? is that what you are saying?

  3. #3
    Chris Shinnick
    Guest

    Default RE: Filtering Letters/Labels for Unique Records

    Thats right. A browse instance of the query shows one unique instance of each name, yet the record selection for printing ignores and treats the current selection of records as if the unique flag were not in place.

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records


    Chris,

    There may reasons for not doing so, but have you considered unmarking all the records, running the query to find unique entries, marking them, and then just printing the marked entries? It's an extra step or two, but...

    -- tom

  5. #5
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records


    Chris,

    Is your envelope layout based on the same table as the table against which your query is being run?

    -- tom

  6. #6
    Chris Shinnick
    Guest

    Default RE: Filtering Letters/Labels for Unique Records

    The envelope layout IS based on the same table as the query.

    I am not able to go through the process of unmarking all records, querying unique names and then marking them. There is another report that is generated that need to have all the marked records, even the duplicates. The report prints first, then envelopes print for each addressee.

  7. #7
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records


    Chris,

    Your problem is very curious. Any chance you can post a working model here so we can look at the details?

    -- tom

  8. #8
    Chris Shinnick
    Guest

    Default RE: Filtering Letters/Labels for Unique Records

    I am attaching a copy of the database.

    The process that would normally occur is a person would go through and mark all records that need to be marked. Then run the PID Marked A query. Then print the Affidavit of Mailing Report. Then Print the PID Envelope A letter. Then run PID Marked B query. Then Print the PID Envelope B letter.

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records

    Chris,

    Thanks. I was able to duplicate the problem here, and did not see a quick fix. Will look further tonight, if the creek doesn't rise too high!

    Have you thought about using a report, instead of a letter layout? I recall others who have hit limitations of the letter engine that do not seem to be present with the report engine. Maybe a properly formatted report can be used to crank out your envelopes for you?

    -- tom

  10. #10
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records

    Chris,

    Here's a solution to your dilemma, but no explanation for why it was happening in the first place.

    Run PID Marked B query;
    Then print / preview TstReport.

    Design notes in the report layout explain what's going on.

    Let me know if you have questions.

    -- tom

    Note to lurkers: Solution involved using a report with a group break, suppressing the report details band, and using the group header band, formatted as a #10 envelope. Report begins new page each time the group breaks. The effect is to get one envelope for each group. I broke the group on the Names field, so you get one envelope for each "Name" in the currently selected records, regardless of how many times that name may be repeated in succession. You can't do this kind of thing in the letter layout because I don't believe it supports group breaks.

  11. #11
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default RE: Filtering Letters/Labels for Unique Records


    Ok, time to refill the coffee cup.

    Here's the file.

    Unzip it to a separate folder. Do not mix with your development work.

    -- tom

  12. #12
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,310

    Default RE: Filtering Letters/Labels for Unique Records

    in version 5 you can use a new function
    key_unique_value() in a filter expression to return just unique records.
    key_unique_value() is a special function that returns .t., but internally turns on the unique flag. it is useful in situations where a5 is asking for a filter, but not filter flags.

    for example, say you want to print a report.
    the report.print() method syntax is

    report.print("reportname","filter","order")

    so, you might write

    report.print("labels","overdue>30 .and. key_unique_value()", "lastname")

    this would only print one record for each lastname.

  13. #13
    Chris Shinnick
    Guest

    Default RE: Filtering Letters/Labels for Unique Records

    Thanks Tom! This worked.

Similar Threads

  1. Lost Letters, Labels, Reports, Operations, etc...
    By Anne Freed in forum Alpha Five Versions 2 and 3
    Replies: 8
    Last Post: 08-29-2012, 12:45 PM
  2. Filtering Records
    By Eric Frierson in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-22-2003, 03:48 PM
  3. Filtering Records in a Browse
    By Douglas Wells in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-12-2003, 11:52 AM
  4. Filtering records for reports
    By Larry Ternowski in forum Alpha Five Version 4
    Replies: 8
    Last Post: 10-06-2002, 03:43 PM
  5. Filtering Records in a Set on a Form
    By Vince Salzer in forum Alpha Five Version 4
    Replies: 6
    Last Post: 10-21-2001, 03:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •