CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2000
    Posts
    29

    Distinct predicate

    Hi! I am using ado in my current project. I am setting the record source of the ado run time. In the record source, I used the DISTINCT predicate as part of my SQL. But the result still displays duplicate records. The ado is bound to a grid and displays four fields. The duplicate records displays exactly the same data for the four fields. Please help me. Thank you.


  2. #2
    Join Date
    Aug 2000
    Location
    England
    Posts
    185

    Re: Distinct predicate

    Do you have a primary key set. I dunno if that will make a difference, but it is all I can think of


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Distinct predicate

    Post your SQL

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Aug 2000
    Posts
    29

    Re: Distinct predicate

    my sql is:

    SELECT DISTINCT(handling_lawyer.docketno), draft_documents.date_creatd, draft_documents.docket_num, draft_documents.draft_name, draft_documents.rowid, handling_lawyer.transactiontype FROM handling_lawyer, draft_documents WHERE draft_documents.draft LIKE '%" & txtSearch.Text & "%' AND draft_documents.docket_num = handling_lawyer.docketno AND handling_lawyer.transactiontype = 'case'




  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Distinct predicate

    Try to use the GROUP BY clause for the handling_lawyer.docketno.

    -Cool Bizs

    Good Luck,
    -Cool Bizs

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured