I am trying to convert the datetime output into a date only and i would like to have it in this format:
mm/dd/yyyy
what am i doing wrong here:
select
DATEADD(DAY, CONVERT(INT,(DATEPART(WEEKDAY, dt) - 1)) * -1,dt) as [WeekBeginDate],
SUM(hours) AS TOTAL_HOURS
from myTable
where
uid = 'myUID' and dt >= CAST(DATEADD(WEEK,-5,DATEADD(DAY,(DATEPART(WEEKDAY, GETDATE()) - 1) * -1,GETDATE())) AS date) group by DATEADD(DAY, CONVERT(INT,(DATEPART(WEEKDAY, dt) - 1)) * -1,dt) order by 1