sbbrown9924
Technical User
I need to write a query that will count how many days within a given time interval (defined by param_DateBegin and a param_DateEnd parameters) a worker worked. The table SocialWorkLog is a log that records encounters with ER patients. Each record is datetimestamped.
So if a worker sees one patient the first day and 30 patients the 2nd day and 3 patients the third day, is off the next day, sees 10 patients the next day, then the count should be 4 days. Right now I'm clueless on how to proceed. I have the basic query:
Select * FROM SocialWork Log WHERE SocialWorker=param_SocialWorker and (ServiceDate BETWEEN param_DateBegin AND param_DateEnd)
Any help would be appreciated. Thanks.
So if a worker sees one patient the first day and 30 patients the 2nd day and 3 patients the third day, is off the next day, sees 10 patients the next day, then the count should be 4 days. Right now I'm clueless on how to proceed. I have the basic query:
Select * FROM SocialWork Log WHERE SocialWorker=param_SocialWorker and (ServiceDate BETWEEN param_DateBegin AND param_DateEnd)
Any help would be appreciated. Thanks.