Results 1 to 3 of 3

Thread: listview and sql

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Location
    Turkey
    Posts
    9

    listview and sql

    i want to show total counts of records in listview with sql

    the records

    column1 ,column2
    row1 record1 1
    row2 record1 2
    row3 record1 3
    row4 record1 4
    row5 record1 5
    row6 record2 1
    row7 record2 2
    row8 record2 3


    will be shown like this :

    column1 , column2
    row1 record1 5
    row2 record2 3

    is it possible ?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: listview and sql

    Welcome to the forums

    Easy enough. Build your SQL statement to use GROUP BY statement and a count. In your example, it would return just 2 records, one with a count of 5 and another with a count of 3. Transfering those returned records to a listview is easy enough

    If you are having problems with your SQL statement, you may want to post that. If you are not familiar with a listview, search the forum for example usage
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Location
    Turkey
    Posts
    9

    Re: listview and sql

    thanks i solved by using "group by" and "having count"

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