Hi Israel,
Thank you for using Syncfusion products.
Syncfusion Schedule control do not provide builtin support to handle the database query before fetching the data from database. So we need to create dynamic query to meet your requirement.
Here we are creating dynamic select command based on the ScheduleType and StartDate properties.
Following code snippet select the appointment from the datasource based on the schedule start date and schedule view type.
[c#]if (this.Schedule1.ScheduleType == ScheduleViewType.Day)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(1) + "# ";
if (this.Schedule1.ScheduleType == ScheduleViewType.Week)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(7) + "# ";
if (this.Schedule1.ScheduleType == ScheduleViewType.WorkWeek)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(5) + "# ";
Please refer the sample in the following link which illustrate the above.
http://www.syncfusion.com/support/user/uploads/Sample_f0f3793a.zipPlease let us know if this helps.
Regards,
Selva