Sharepoint By Dummies

See Also: http://stephenbooth.brandyourself.com/

Date comparison sometimes uses previous day!

leave a comment »

We have a list which contains a number of date fields, in a dataview connection tot hat list we are using conditional formatting to show/hide alerters depending on if the date has past.  This is on WSS 3.0 and the alerters with their conditional formatting were added using sharepoint designer 2007.  The users reported that sometimes the alterter for overdue (i.e. the date had passed) was appearing a day early.

The XSL inserted by SPD to impklement the conditional formatting is:

<xsl:if test="normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) = 'Start Date' and number(translate(substring-before(@Planned_x0020_Start_x0020_Date,'T'),'-','')) > number(translate(substring-before($Today,'T'),'-',''))"><img alt="" src="taxi graphics/Greentick[1].gif" width="16" height="16" /></xsl:if>
<xsl:if test="number(translate(substring-before(@Planned_x0020_Start_x0020_Date,'T'),'-','')) <= number(translate(substring-before($Today,'T'),'-','')) and normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) = 'Start Date'"><img alt="" src="taxi graphics/redcross[1].gif" width="16" height="16" /></xsl:if>
<xsl:if test="normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) != 'Start Date'"><img alt="" src="taxi graphics/gray tri.jpg" width="10" height="9" /></xsl:if>

We’ve found that in some cases the truncate on the Planned_x0020_Start_x0020_Date field returns the date of the day before the actual date recorded (so for 15-Jun-12 it returns 20120611 rarther than 20120615).

I’ve posted a question about this on EggheadCafe.

Advertisements

Written by stephenboothuk

June 20, 2012 at 2:33 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Speeches I Would Have Given

What I would have said at conference

markvale.wordpress.com/

Maybe mildy useful to someone!

David Hunt, PE... Mechanical Engineer on the loose!

VALUE = Creativity + Diverse Experience + Critical Thinking

Not Literally Productions

Comedy, parody, tutorials and more!

catastraspie

A personal blog about having Asperger's

Dementia and Elderly Care News

News and research of interest to people involved in Dementia and Elderly Care

Marc D Anderson's Blog

A Knowledge Management Zealot Speaks Out

Codeless Solutions for SharePoint

Bryon Wyly is a SharePoint Developer dedicated to finding the limits to out-of the-box SharePoint solutions

gordonlyew.wordpress.com/

the political blog of gordon lyew

SharePoint Business Analyst

Just another WordPress.com weblog

%d bloggers like this: