Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

MySQL Group By

I have a column with a datatype of DATETIME

I require this as the application requires the date and time in the record, same column

My problem is I want to run a query to group the records by date, it is grouping each row as they all have a diffrent time value (obviously). I want to group by the date only.
0
Brogrim
Asked:
Brogrim
1 Solution
 
dsackerContract ERP Admin/ConsultantCommented:
Hopefully this example will help:
select  date(DatetimeColumn),
        sum(ColumnToSum)
from    tablename
group by date(DatetimeColumn)

Open in new window

0
 
BrogrimAuthor Commented:
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now