Introduction

In this article we can explore some of the challenges faced working with the Client Object Model along with Date values.

Challenge

You are working on a Task list which contains creation date of different months. You need to search and find the tasks of
the current month. How do we achieve this using CAML at the Client Object Model?

Data

Following is the data for the Task list:

Note: The test application contains a Create Data button to generate the list
and data for you. Please ensure you are running on a test SharePoint Server.

Using the Application

You can download and run the attached source code.

The buttons perform the following:

Create Data: Creates the Task list with some monthly data

Show All Data: Shows all the items in the Task list in the grid below

Show this Month Data: Shows only the current month data using CAML query filtering

CAML Query Builder

Executing the Application

On executing the application and clicking the buttons, we can see the results below:

The first task list displays all the items and the second task list displays only the items in the current month based on the Due Date column.

Summary

In this article we have explored the solution for handling date in the Client Object Model. I hope the code could help you in a scenario involving Client Object
Model. The attachment contains the code we have discussed.