This tutorial uses DayPilot Scheduler control to create a simple annual leave booking tutorial.
Create a special column for displaying the totals:
<DayPilot:DayPilotScheduler ID="DayPilotScheduler1" runat="server" ... > <HeaderColumns> <DayPilot:RowHeaderColumn Title="Person" Width="80" /> <DayPilot:RowHeaderColumn Title="Total" Width="80" /> </HeaderColumns> </DayPilot:DayPilotScheduler>
Calculate the summary using the following SELECT command:
SELECT [Person].[PersonId], [Person].[PersonFirst], [Person].[PersonLast], sum(datediff(minute, [ReservationStart], [ReservationEnd])) as [Total] FROM [Person] left outer join [Reservation] on [Person].[PersonId] = [Reservation].[PersonId] and NOT (([ReservationEnd] <= @start) OR ([ReservationStart] >= @end)) GROUP BY [Person].[PersonId], [Person].[PersonFirst], [Person].[PersonLast] ORDER BY [PersonLast], [PersonFirst]
The sample project (including DayPilot Pro trial and C# and VB source) is available for download.