.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SPQuery to get all Items Modified in Current Month/Year

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

I have a SharePoint List. Using CAML I need get all the Items that are modified in the current Month/Week/Year.? 

Can anybody help me to achieve this?




View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

CSS - formatting block list items for the current page

I have a sidebar containing an un-ordered list (menu). Each list item is contained in a light grey block when the user hovers over it with the mouse. However I would also like the block to stay grey for the current page that the user is on. HTML <div id="sidebar"> <ul> <li><a href="../001.aspx">001</a></li> <li><a href="../002.aspx">002</a></li> <li><a href="../003.aspx">003</a></li> <li><a href="../004.aspx">004</a></li> <li><a href="../005.aspx">005</a></li> </ul> </div> <!-- end #sidebar --> CSS/* Sidebar */ #sidebar { float: left; width: 15%; padding: 10px 0px 0px 40px; } #sidebar ul { margin: 0; padding: 0px; list-style: none; line-height: 0px; } #sidebar li { font-size: 11px; line-height: 280%; text-transform: uppercase; letter-spacing: 2px; font-weight: normal; } #sidebar a { display: block; } #sidebar a:hover { text-decoration: none; font-weight: normal; color: #7584BD; background: #F2F2F2 } Very simple really, and used everywhere. I have been looking at free CSS examples to try and solve this problem, but the only so

Date format for Year, Year-Month, and Date (Year-Month-Day) where input is not known

I have a requirement to capture historical events in a table. Now some events will have only Year, some Year/Month, and remaining where Date is known. We should be able to store them in the column and be able to sort etc. When publishing the information, we should be able to publish as was the input, Year only, Year-Month only, or Date. I looked at the newer Date data type. I can insert a 4 digit year, but on retrieving it is YYYY-01-01. I do not know if it has input YYYY or YYYY-MM-DD and is indeed a Date or a Year. I am trying to avoid saving the format information in another column or something. For sorting, when records have same Year, I would have another column to do relative sorting... So question is - what are my best options with SQL/Entity Framework combo. And what others have done, when encountering similar - if any. Thanks in advance. --Sharad 

How i can view last 5 days records in current Month

Suppose i have a tableAppno Receive_Date Send_Date 1 9/3/2010 9/3/2010 2 9/3/2010 null 3 9/4/2010 9/4/2010 4 9/9/2010 9/9/2010 i m trying to run this select * from search where datediff(d,send_Date,getdate()<5

Display the Sum of hours and Month Year using sql Query

Hi,  I have,hours(in varchar),Id in table tbl_x ,i need the sum of hours, monthyear(eg. mar 2010)for the last three months.But with two separate queries i am getting these results.but actually i need in the following format   Month/Year      TotalHours-----------------    ----------------Mar 2010            0400Apr 2010             0450-----------------------------------to get month/Year i am using this querySELECT right(convert(varchar, fromdate, 106), 8) from tbl_x where id='11101' for the sum of hours SELECT SUM(CAST(hours AS INT))AS TOTALHRS FROM tbl_x WHERE id='11101'

report expression for month and year

Hi , Can anyone help me how to write a report expression to get the following out put? Actually this value is the month of previous month. I want to set default month name of the parameter to previous month. This is sep.So it should display like this; Aug - 10 Thanks shamen

Items collection cannot be modified when the DataSource property is set.

I am having two listboxes which performs Drag and Drop, when i drag and leave on to second listbox I am getting the error: Items collection cannot be modified when the DataSource property is set. code: using     System; using     System.Collections.Generic; using     System.ComponentModel; using     System.Data; using     System.Drawing; using     System.Linq; using     System.Text; using     System.Windows.Forms; namespace     WindowsControlEx8 {     public partial class Form1 : Form {     List<Colors> colors = new List<Colors>() {     new Colors{colorName="Red"},     new Colors{colorName="Green"},     new Colors{colorName="Black"},     new Colors{colorName="White"},     new Colors{colorName="Orange"} };         public Form1() { InitializeComponent();   }     private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { }     private void button1_Click(object sender, EventArgs e) {     var c = from c1 in colors     select c1.colorName; listBox1.DataSource = c.ToList();   } &nb

How to Correlate Last weekday of previous Month and First Weekday of current Month ? - T-SQL 2005

Hi friends, below is my detail description. I woulld like to show busines users Previous Months Last Weekday in Drop Down List as a Parameter. Now, if they select Previous Months Last Weekday, then i need to pass First weekday of Current month. How can i correlate this things ? if you need more information, let me know.   Thanks.

webdav xmlhttprequest to query current users exchange mailbox items


I would like to use xmlhttp request to display the current users unread email count in a webpart.  I can get this to work if the user enters their username & pw, but I'm not able to get any pass-thru credentials to work.  How can we set this up to pass through the current user's credentials.  We tried to set the sharepoint wfe with kerberos trusted delegation, but this doesn't seem to work.

We do not want to create an account with full access to all private mailboxes.

Selecting current,previus month values


hi friends,

consider that i have columns like tax_amount,item_amount,month,year in a table..

i want to get

current month & year - tax_amount,item_amount

previus month and current year- tax_amount,item_amount

current month &  previus year - tax_amount,item_amount

how to get all the values in a single select query.

i am waiting for ur reply..

List of Month and Year in SSRS report parameter?

Hi, I have two parameters in my SSRS Report i.e. Month and Year. I want to show the list of all Months in dropdown and years for a particular range say 1995-Current Year.
Can any one suggest me the query for how to get it to work.
Thanks!! MCP

MDX to pick the data from first day of the current month



I need to make a mdx query to pick the data from first day of the current month.

SELECT [Measures].[Internet Sales Amount] ON COLUMNS,

[Date].[Fiscal].[Date].MEMBERS ON ROWS

FROM [Adventure Works]


The above query returns around 4 years of data, but I need the data from first day of the current month.


Could anybody help me out!!!






Ignore date and consider month and year to match


Hi there,

It is required to retrieve the records where ONLY Start Month, Year AND End Month, Year are passed. Trying below SQL to get these with no success. 

registrationdate BETWEEN(MONTH((registrationdate) = 01) AND (Year(registrationdate)= 2009)) AND ((Month(registrationdate) =03) AND (Year(registrationdate)=2010))


Help is appreciated.

Content Query WebPart shows page items with status "draft", and page items that current user does no



I have this issue that CQWP is rendring items that it should not render. I test this with a read-only user, that should NOT see draft pages or pages with different permissions. But the read-only user do see the items, but when I click on the link I get access denied. This access denied is correct, but why does the page items appear in the CQWP at all?


1) I use OOTB CQWP (inherits from ContentByQueryWebPart in my .webpart file) : "<type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart ....." and I have my custom xsl to get the look and feel I need

2) The issue with page items showing when status = drafts only appear when using the PublishingExpirationDate field. When I try creating new pages and give them status draft by using "check in to share draft" (logged on as an contributer/approver user), this item wil NOT appear in the CQWP for the read-only user. When I change a pages' status from approved to draft, this item will still be shown in the CQWP, but this will point correctly to the published version. But after the pages' expired date (PublishingExpirationDate) is expired, the page gets status "draft" (handeled by a timer job I guess), and this page item will still be rendered in the CQWP, but sending the read-only user to an access-

I need to display and group by month/year


I have this date format from



(CHAR(10),(INVC_DT),112) = 20090102 

but I just need the month and year in order to do the aggregations with...

month / year formatted dates


I need to convert an invc_date from 2009-01-01 00:00:00.000 to MM-YYYY


I have tried some of the stuff but not quite working for me yet

Get the month and year?


How do I write my SQL so I get this result?

... and so on
... and so on

I'm building a blog and want to have this as links. I have a field in the database "CreateDate".

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend