Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Help with between statement in a select

I have a table with a list of dates and hours associated with those dates. I want to produce a report that sums the hours for a month. I want to change all the dates for a month to the same date for a group by statement. How can I accomplish this?
Avatar of Aneesh
Aneesh
Flag of Canada image

SELECT  CONVERT(varchar(6), datecolumn, 112) +'01' as date, sum(hrs) totl
from yourTable
GROUP BY CONVERT(varchar(6), datecolumn, 112)


** Note : in future, it will always better if you provide the table structure or sample data'
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you try the first one ?