I have a list and I would like to get the data that is about to expire in 10 or less days. So I have two fields creation date and expire date.
Can anyone tell me how can I achieve this using spquery or anyother way in sharepoint?
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are 2 ways to query data (Excluding querying across an entire site collection) SPQuery and SPMetal(LINQ to SharePoint).
In general I try to use SPMetal generated objects and only go to CAML(SPQuery) for complex queries.
Here is 2 examples first using SPMetal objects.
Now SPQuery
For some information on CAML see http://sharepointmagazine.net/articles/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list. (I had to use OffsetDays instead of Offset to get the above working).
Can just google SPMetal for more information on it. One tool that is nice is the CKS Development tools as it can generate this class(es) with just a few clicks in visual studio.