Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SUMM recorset fileds and recopy in listview1 (2000)

    Open a recordset using the following SQL string:

    Dim strSQL As String
    strSQL = "SELECT CAMPO1, CAMPO2, CAMPO3, CAMPO4, CAMPO5, Sum(CAMPO6) AS SUMMA6 " &_
    " FROM NomeTabella GROUP BY CAMPO1, CAMPO2, CAMPO3, CAMPO4, CAMPO5"

    where NomeTabella is the name of the table.
    Fill the listview from this recordset. The sum field is named SUMMA6.

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SUMM recorset fileds and recopy in listview1 (2000)

    ok...
    But to execute the sql is corect the line:
    Set RSSQLD = CNSQL.Execute(strSQL)

    to have the new rset?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SUMM recorset fileds and recopy in listview1 (2000)

    Yes, you can use that, or

    Dim RSSQLD As New ADODB.Recordset
    RSSQLD.Open strSQL, CNSQL

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SUMM recorset fileds and recopy in listview1 (2000)

    Note: i use the tipical ADO conn.
    In the excel file are a table structure and a listview1 structure.
    Now i want to select dinstinct based CAMPO1 and recopy in listview1 but with total summ of CAMPO6...
    Result is in listview1 in excel file attached.

Posting Permissions

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