Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count days that a person worked

Status
Not open for further replies.

sbbrown9924

Technical User
Mar 7, 2003
80
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top