Finally figure out the sql and pasted into my query successfully. However the result of TotalDocReceived is not as expected. For example, if I execute the query with received date = 13 Mar 2016, the result should be 2 records only, ie Alice and William. TotalDocReceived for Alice should be 1 and William should be 1 too. Any idea which part of the sql should I amend to get the result? thank you!