how can i group the database by dates and by names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RhazeMondragon
    New Member
    • Oct 2007
    • 10

    how can i group the database by dates and by names

    i was have difficulties by retrieving records in the database, for example i want to get the sum of transaction by the date, group by people,,
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to use GROUP BY in the SQL query.

    Post your table structure for more details.

    Comment

    • 9815402440
      New Member
      • Oct 2007
      • 180

      #3
      hi
      your sql query must look like this

      select sum(column) from table group by Date, People

      if this is not the solution then explain your problam in detial

      regards
      manpreet singh dhillon hoshiarpur

      Comment

      • daveftl
        New Member
        • Jan 2007
        • 43

        #4
        Originally posted by RhazeMondragon
        i was have difficulties by retrieving records in the database, for example i want to get the sum of transaction by the date, group by people,,
        try this sql:

        SELECT SUM(transaction ) FROM <table>, ORDER BY <table.date>;

        for more detailed answer..please post ur DB structure . :)

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by RhazeMondragon
          i was have difficulties by retrieving records in the database, for example i want to get the sum of transaction by the date, group by people,,
          I recommend you ask in the Access forum, as the people there have lots of database experience.

          Comment

          • RhazeMondragon
            New Member
            • Oct 2007
            • 10

            #6
            this is my databse.... is this correct???

            "Select F_Empl_Code, Supply_Date, Sum(Supp_Total) , Min(Supp_Balanc e) from Tbl_Supply_Tran saction Where Supply_Date between '" & txtDate1.Text & "' and '" & txtDate2.Text & "' GROUP BY F_Empl_Code, Supply_Date

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by RhazeMondragon
              this is my database...
              My SQL syntax is a bit shaky. But what type of database is it? Access? SQL Server? Other? The different products do treat things slightly differently. In Access, date fields use hashes (#) as a delimiter, not quotes (').

              Comment

              Working...