SharePoint Object Model

CAML Query Search Between Two Date Ranges : SharePoint

SPSite site = new SPSite(“http://localhost:3001”); SPWeb web = site.OpenWeb(“MyWeb”); SPList list = web.Lists[“MyList”]; //RequestStartDate & RequestEndDate will be passed in mm/DD/yyyy format. //They can extend  to work with time also. string startDate = (SPUtility.CreateISO8601DateTimeFromSystemDateTime(Convert.ToDateTime(this.RequestStartDate))); string endDate = (SPUtility.CreateISO8601DateTimeFromSystemDateTime(Convert.ToDateTime(this.RequestEndDate))); SPQuery query=new SPQuery(); query.Query = “<Where><And><Geq><FieldRef Name=’Date_x0020_of_x0020_Meeting’ /><Value Type=’DateTime’>” + startDate + “</Value></Geq><Leq><FieldRef Name=’Date_x0020_of_x0020_Meeting’ /><Value Type=’DateTime’>” + CAML Query Search Between Two Date Ranges : SharePoint