Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    Covington, LA
    Posts
    46

    Exclamation Unanswered: Picky Query Problems

    i have a query that i want to only show records that have atleast one "Processed-Unpaid 120+ Days" status record per [RequesterName]. if there is not a record 120+ record for that requester, then it does not select any recprds for that requester, but, if it has one or more 120+ status records for a requester, it selects all other "Processed-Unpaid" or "Processed-Unpaid 30 Days" or "Processed-Unpaid 60 Days" or "Processed-Unpaid 90 Days" for that requester.

    does anyone see what i need done. this is a query for a report we need to give our debt collecting company. the report groups the records by the Requester, then the Status, then it shows invoices. i set up code so that olny invoices in the "Processed-Unpaid 120+ Days" group show up, but the other statuss total in the group footer still shows. we don't want to have the collectors go after only the people with invoice over 30 days past due. when someone lets and invoice go past 120+ days, then we want to show that information on the 120+ invoice and show the totals for invoice in the other status groups (ex: Processed-Unpaid, Processed-Unpaid 30 Days, Processed-Unpaid 60 Days, and Processed-Unpaid 90 Days)

    thanks
    Unique like everyone else,
    Clark
    -------------------------------------------
    POSTING IS THE TERRIBLE SECRET OF SPACE!

  2. #2
    Join Date
    Nov 2002
    Posts
    150

    Re: Picky Query Problems

    We will create 2 queries to solve this one.

    Query 1:
    SELECT DISTINCT RequesterName <or table key> FROM <table> WHERE <some_field> = 'Processed-Unpaid 120+ Days' <or lookup code>

    Query 2:
    SELECT A.* from <table> A, <Query 1> B
    WHERE <key from A> = <key from B>

    You need to fill in all the <> with the appropriate info from your system.

  3. #3
    Join Date
    Mar 2002
    Location
    Covington, LA
    Posts
    46

    thanks FirstAndGoal4

    THAT WAS IT! thanks alot FirstAndGoal4. i seriously need to work on my sql skills..... wait.... i dont have any skills to work on. thanks alot.
    Unique like everyone else,
    Clark
    -------------------------------------------
    POSTING IS THE TERRIBLE SECRET OF SPACE!

Posting Permissions

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