Results 1 to 5 of 5

Thread: getting sum of a duplicated record using sql

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2007
    Posts
    31

    getting sum of a duplicated record using sql

    I have a table that stores income and expenditure. every time an entry is made, it is saved independently in the table so as to be able to track every income or expenditure entered. i would want to get a list of all incomes and expenditure saved in the table with the sum without repeating any record. am using vb6 and ms access, i would like appreciate your help.

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

    Re: getting sum of a duplicated record using sql

    Moved From the FAQ Section

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: getting sum of a duplicated record using sql

    Why would there be repeating records?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: getting sum of a duplicated record using sql

    He probably did a join which result in columns from one table being repeated...depash, post you current SQL query.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2007
    Posts
    31

    Re: getting sum of a duplicated record using sql

    selectRecord.Open "SELECT account, drcr from tbl_incomestmt where IncomeDate between #" & f & "# and #" & t & "# and acc_period_id = " & activeAccountingPeriod & " order by tbl_incomestmt.head_no;", Cn
    Set rpt_incomestmt.DataSource = selectRecord

    The records are repeated becease every time an entry is made, it is saved in the table and not updating any record. the same case which happens when a customer buys items in a shop using a POS, this will help me to view all sales per day and whichever day they want

Tags for this Thread

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