Results 1 to 5 of 5

Thread: Line numbering in recordset

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Virac
    Posts
    129

    Line numbering in recordset

    strSQL = "SELECT tblBillDetails.*, " & _
    "(tblBillDetails.SubscriptionFee + tblBillDetails.InstallationFee + tblBillDetails.Arrears + tblBillDetails.Others) as TotalAmountDue, " & _
    "(tblSubscribers.Lastname & ', ' & tblSubscribers.Firstname & ' ' & tblSubscribers.Middlename) as SubscriberName, " & _
    "tblSubscribers.Barangay " & _
    "FROM tblBillDetails " & _
    "INNER JOIN tblSubscribers ON tblBillDetails.SubscriberNo=tblSubscribers.SubscriberNo " & _
    "WHERE MasterBillNo='" & strMasterBillNo & "' " & _
    "ORDER BY tblSubscribers.Barangay, tblSubscribers.Lastname, tblSubscribers.Firstname, tblSubscribers.Middlename"

    This query will return a recordset. Normally, it does not have a line numbering in each row.

    Can anyone help me modify this code so that i can add line number which is autoincrement or serially.

    thanks a lot!


    BTW. I am using MS Access and VB6 and ADO.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Line numbering in recordset

    What do you do with the records that are returned in the recordset?

  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Line numbering in recordset

    What database are you using?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Line numbering in recordset

    Judging by the use of the tbl prefix in the table names, I would guess Access.

  5. #5
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Line numbering in recordset

    Quote Originally Posted by boyet0911
    . . . BTW. I am using MS Access and VB6 and ADO.

    Quote Originally Posted by Hack
    Judging by the use of the tbl prefix in the table names, I would guess Access.

    I guess we missed this part. So I guess my Stored Procedure example wouldn't apply.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


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