Since XSL in SharePoint Designer does not have a very good support for date comparisons. I Googled for at least more than half of the day for a decent date comparison and came across this post as a solution by ma man Kotendra. However, this post assumes that date is provided in ISO format (YYYMMDD). This was not my case…so I Googled bit more and bit more and little bit more :o) and here is the solution.
Below is the formula (XSLT Filtering) to compare dates in SharePoint Designer using XSL:
[
number(ddwrt:FormatDateTime(ddwrt:FormatDate(string(@Open_x0020_Date),1033,1),1033,'yyyyMMdd'))
>=
number(ddwrt:FormatDateTime(ddwrt:FormatDate(string($varFromDate),1033,1),1033,'yyyyMMdd'))
]
Above formula will convert date 5/31/2009 into 20093105 and treat it as a number to compare with another number converted from date.
Thanks!
Subscribe to:
Post Comments (Atom)
-
Following is an example of using Charts.js library to display nice graphs & charts after providing the data via C#/ASP.NET: Download ...
-
Scenario: Updating the Master Page for SharePoint Online is not recommended by Microsoft now.....fine. So how do we change the UI then? And...
-
In this blog post, I will cover what is a workflow and how we can create a workflow using Microsoft Flow that can make HTTP REST calls to br...
Official SharePoint Documentation
I have recently contributed to the official SharePoint documentation for developement. Check it out here: https://docs.microsoft.com/en-us...
Shouldn't it be converted to 20090531 to get a good comparason? Year Month Day.
ReplyDelete200905311330 for 13:30 or 1:30 PM for time to be included
Its actually the same approach.
ReplyDelete