dcsimg
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
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: getting sum of a duplicated record using sql

    Moved From the FAQ Section
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,681

    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
  •  



Featured


Click Here to Expand Forum to Full Width