SPSite oSite = SPContext.Current.Site;
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists["ListName"];
SPQuery oQuery = new SPQuery();
oQuery.Query = ""
+ "";
SPListItemCollection oItems = oList.GetItems(oQuery);
To filter on date use the following to get any item that has been modified in the last 7 days:
string dateString = Microsoft.SharePoint.Utilities.
SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Today.AddDays(-7));
oQuery.Query = "+ dateString+"
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists["ListName"];
SPQuery oQuery = new SPQuery();
oQuery.Query = ""
+ "";
SPListItemCollection oItems = oList.GetItems(oQuery);
To filter on date use the following to get any item that has been modified in the last 7 days:
string dateString = Microsoft.SharePoint.Utilities.
SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Today.AddDays(-7));
oQuery.Query = "+ dateString+"