I currently have this query that I would like to have the DATEDIFF
to just include "working days" So It'll only include Monday - Friday (the hours of operation doesn't matter)
Select
a.SiteID,
DATEDIFF(d,a.Mino,a.Maxo)
FROM
(Select
sn.SiteID,
MAX(sn.CreationDate) Maxo,
MIN(sn.CreationDate) Mino
From SiteNotifications sn
Group By sn.SiteID) a
So far it's just doing ALL days - which is to be expected but is there anyway I can capture just Monday - Friday?
BTW for further clarification here is a sample of what the query outputs (note that each SiteID also has it's own Min and Max times - they aren't all the same date range).
SiteID | Days
-------------
123456 | 0
-------------
789012 | 0
------------
654321 | 31
So the 0's are min and max dates that are the same (or the same date I should say) so that's fine. The 31 days - since I know thats about a month and the month has about 8 weekdays - should really be '23'