Extract Date from a DATETIME data type in SQL 2005
Posted on 2013-11-14
I have a view I am creating and I want to group by an extracted date from a column that has a date and time. This is where I am....
ClockCode AS MOnum, SUM(Actual_Hrs) AS Runtothours, TStamp
(Actual_Hrs > 0) AND (ClockCode LIKE 'MO%')
AND (TStamp > CONVERT(DATETIME, '2013-01-01 00:00:00', 102))
so while I have it grouped by the TStamp column there is a record for each one based on the time... I am looking to get a total amount of run time for each order by date not date and time.
The TStamp column is formatted as:
and its data type is datetime...
All I am finding my research doing is complicating it...