I don't know what ods_start_date is but the following example should give you an idea. Since you didn't post any schema/sample data, I'm using a var table in sql server with some sample data i created. My columns are a bit different but you should be able to see the general direction of where this is headed.
DECLARE @WorkOrders TABLE (
WorkOrderId INT NULL,
RequiredBy DATETIME NULL,
DateCreated DATETIME NULL
);
INSERT INTO @WorkOrders ( WorkOrderId, RequiredBy, DateCreated)
VALUES ( 1 ,
'2017-07-25 13:50:03.000',
GETDATE()
)
INSERT INTO @WorkOrders ( WorkOrderId ,RequiredBy ,DateCreated)
VALUES ( 1 ,
'2017-07-25 13:50:03.000',
GETDATE()
)
INSERT INTO @WorkOrders ( WorkOrderId ,RequiredBy ,DateCreated)
VALUES ( 2 ,
'2017-07-25 13:50:00.000',
GETDATE()
)
INSERT INTO @WorkOrders ( WorkOrderId ,RequiredBy ,DateCreated)
VALUES ( 2 ,
'2017-07-25 13:50:00.000',
GETDATE()
)
INSERT INTO @WorkOrders ( WorkOrderId ,RequiredBy ,DateCreated)
VALUES ( 2 ,
'2017-07-25 11:50:03.000',
GETDATE()
)
SELECT WorkOrderId,RequiredBy, COUNT(*) AS WorkOrderCount FROM @WorkOrders
GROUP BY WorkOrderId,RequiredBy
SELECT WorkOrderId,CAST(RequiredBy AS DATE), COUNT(*) AS WorkOrderCount FROM @WorkOrders
GROUP BY WorkOrderId,CAST(RequiredBy AS DATE)
I'm not clear on what ods_start_date is so you'll have to include it in my example if you try running it but otherwise this should provide you the general idea.
I've included two queries, one that gets counts by date and time. In this one you'll see how work order 2 has two rows since there are 2 different unique times for that work order.
The second is if you were to count work orders by required date (Date) only. So you'll see its broken down into 2 entries and the counts adjust by date instead of date + time for work order 2.
Feel free to ask any questions.