Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a project updates list that tracks updates on a list item within the projects list.

I have created an InfoPath form that the Project Manager fills out instead of using a sharepoint built-in form.

I have been requested to auto-populate the last Update's information for the project selected to make it easier for the project managers (i.e: budget didnt change between this week and last week). I took a screenshot of the form and annotated it for easier explanation..

My Problem

my problem is im trying to sort the returned results of the search by DESC order, so it pulls the latest update instead of the very first.

For example: Currently, if i have two previous updates

8/1/12 - $1,000
8/2/12 - $5,000

The form is pulling the $1,000 and not the $5,000 as that is the least greatest.

In SQL id do something like:

SELECT EstimatedBudget FROM projectUpdates pu WHERE pu.Project = ProjectID AND pu.updateDate = updateDate ORDER BY pu.updatedate DESC LIMIT 1;
//which would return one row, 5000

The constructed value that the rule sets the estimatedBudget field to is:

EstimatedBudget[Project = Project and msxsl:string-compare(UpdateDate, UpdateDate) <= 0]

enter image description here

share|improve this question
    
Can you upload your XSN template to file sharing site and give here the link in order to more clearly understand the details of your situation? That is your expressions "Project = Project" and "string-compare(UpdateDate, UpdateDate)" are constructed by GUI and in textual form (without details of data sources and references to them) do not provide any information –  Gennady Vanin Novosibirsk Aug 9 '12 at 6:50

1 Answer 1

my problem is im trying to sort the returned results of the search by DESC order, so it pulls the latest update instead of the very first.

There is no need to sort in order to get the latest record, use last() for this

If you want more specific answer, please share your XSN template file

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.