Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:30:06+00:00 2026-05-27T13:30:06+00:00

I am developing silverlight web part. I have a one List Entry log. In

  • 0

I am developing silverlight web part. I have a one List Entry log. In this list I am storing all the entries of basic information. All the entries are saved successfully. Now I want to retrieve the maximum date and minimum date on which these entries are created in the Entry log list. So I am using the following code

    public void PopulateTimeLog(String paymentStatus, String currentUser, timeLogDelegate populateCombo)
    {
        timeLogDelegateClient = populateCombo;

        ClientContext clientContext = ClientContext.Current;
        List list = clientContext.Web.Lists.GetByTitle("Time Log");

        string query = "<View>";
        query += "<Query>";
        query += "<Where>";
        query += "<And>";
        query += "<Eq>";
        query += "<FieldRef Name='Author'></FieldRef>";
        query += "<Value Type='Lookup'>" + currentUser + "</Value>";
        query += "</Eq>";
        query += "<Eq>";
        query += "<FieldRef Name='Payment_x0020_Status'></FieldRef>";
        query += "<Value Type='Text'>" + paymentStatus + "</Value>";
        query += "</Eq>";
        query += "</And>";
        query += "</Where>";
        query += "<OrderBy>";
        query += "<FieldRef Name='Created' Ascending='False'></FieldRef>";
        query += "</OrderBy>";                       
        query += "</Query>";
        query += "</View>";            

        CamlQuery Query = new CamlQuery();
        Query.ViewXml = query;

        listItemsTimeLog = list.GetItems(Query);
        //clientContext.Load(list);
        //clientContext.Load(listItemsTimeLog);

        clientContext.Load(listItemsTimeLog, itms => itms.Include(
                                                        itm => itm["Created"]));


        clientContext.ExecuteQueryAsync(HandleTimeLogRequestSucceeded, HandleTimeLogRequestFailed);

    }

    private void HandleTimeLogRequestSucceeded(object sender, ClientRequestSucceededEventArgs e)
    {
        ////call back on the UI thread
        System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
        {

            timeLogDelegateClient(listItemsTimeLog);
        });
    }

In the above code I will get the the maximum date in listItemsTimeLog at index 0 and minimum date in listItemsTimeLog at last index. In the above query i dont want to retrieve all the dates in the listItemsTimeLog. How Can I simplify the above query so that I will get only two string values – One string will contain maximum date and other string will contain mimimum date . If I can do it through web service then it is also fine for me ? How can I do this ? Can you please provide me any code so that I can solve the above issue ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:30:07+00:00Added an answer on May 27, 2026 at 1:30 pm

    You can use RowLimit for this, e.g.

    Max

    <View>
      <Query>
        <Where>
          <And>
            <Eq>
              <FieldRef Name='Author'></FieldRef>
              <Value Type='Lookup'>[your use name]</Value>
            </Eq>
            <Eq>
              <FieldRef Name='Payment_x0020_Status'></FieldRef>
              <Value Type='Text'>[ your payment status]</Value>
            </Eq>
          </And>
        </Where>
        <OrderBy>
          <FieldRef Name='Created' Ascending='False'></FieldRef>
        </OrderBy>
      </Query>
     <RowLimit>1</RowLimit>
    </View>
    

    Min

    <View>
      <Query>
        <Where>
          <And>
            <Eq>
              <FieldRef Name='Author'></FieldRef>
              <Value Type='Lookup'>[your use name]</Value>
            </Eq>
            <Eq>
              <FieldRef Name='Payment_x0020_Status'></FieldRef>
              <Value Type='Text'>[ your payment status]</Value>
            </Eq>
          </And>
        </Where>
        <OrderBy>
          <FieldRef Name='Created' Ascending='True'></FieldRef>
        </OrderBy>
      </Query>
     <RowLimit>1</RowLimit>
    </View>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing silverlight web part for sharepoint 2010. I have an xml file
I am developing a Silverlight web part for Sharepoint 2010. I have a button
I am developing silverlight web part for sharepoint 2010. In my project I have
I am developing silverlight web part by using the client object model. I am
I'm a .Net developer and want to get into developing Silverlight applications. I have
I am developing a Silverlight app using VS2008 Express. I have just implemented a
I am developing a Silverlight 3 application and I would like to delegate all
I'm developing a small web application using Microsoft Silverlight 3. I'm using Microsoft Expressin
At the moment I'm developing a web based application using Silverlight 3.0. For the
I'm developing a Silverlight 3 app and getting this really weird error when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.