Hey guys,
I have reports that pull from queries to display information on employees and their hours spent offsite. The queries that are being used are setup as follows:
QsspWeekly - Provides information only on last work week (sun-sat)
QsspMonthly - Provides information (month to date)
QsspYear - Provides information (year to date)
One of the reports that I generate, is to display the employee, and the dates that that employee worked offsite. The requester of the report wants to only see the dates as ranges.
Example: John Doe worked offsite on 9/1,9/2,9/3,9/5 and 9/6.
I would like to display it as:
John Doe 9/1/15-9/3/15
9/5/15-9/6/15
My first attempt was to use Min and Max dates in 2 columns, which kind of works for the weekly report, but only by luck. Since it is only pulling the highest and lowest dates, the above example would yield 9/1/15-9/6/15 as the result.
I realize that there is a datediff function...and I realize that for a consecutive date range, the date diff would be less than or equal to 1 (less than incase they had 2 shifts in a single day). I feel like I have all of the pieces there, but for the life of me, I can't get this working, and I am extremely frustrated at the simplicity that I am most likely overlooking. If somebody could explain to me (in the most dummy proof way possible) how to accomplish my goal, they would be my hero for the day! Lol.
Thanks in advance for any help!