Results 1 to 5 of 5

Thread: nid help using datagrid

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    38

    nid help using datagrid

    hi, i got a table with this fields

    employee_name salary

    i know how to display records of a specific employee, now i want to get his/her total salary based on his/her number of records

    thx in advance

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: nid help using datagrid

    SQL : SUM function.... :: http://www.techonthenet.com/sql/sum.php

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    38

    Re: nid help using datagrid

    Private Sub Command1_Click()

    Adodc1.RecordSource = "SELECT SUM(salary) AS totalsalary FROM Table2;"
    Adodc1.Refresh

    End Sub

    how do i pass the value to a variable?

  4. #4
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: nid help using datagrid

    Perhaps something like:
    Code:
    Dim TS
    TS = Adodc1.RecordSet.Fields(0).Value

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: nid help using datagrid

    Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)

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