Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / July 2007

Tip: Looking for answers? Try searching our database.

XPath Date Comparison not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JustinDevine - 24 Jul 2007 23:01 GMT
I have seen this issue mentioned multiple times.  However it is my
understanding after reading many, many posts that this should work,
yet it is not working and I am looking for some help.

I am not looking to perform a date CALCULATION only a COMPARISON which
I understand to be possible using string-compare.  Here is the
situation and sample xpath statement

1.  I am populating a listbox with dates from a sharepoint calendar
list, these dates come in as the @Begin field and always include date
and Time

2.  I want to filter this field so only events in the future show up.
Therefore I need to compare the sharepoint @Begin with today() and
filter for those entries in which @Begin > Today()

3.  I am attempting to use the following filter on the field with
absolutely no success.  The use of substring is used in order to
truncate the date/time sharepoint sends into an 11 character date that
parallells the ISO type that Infopath uses.  I have tested the
substring in a separate field and get YYYY-MM-DD just as I expected.

msxsl:string-compare(substring(., 0, 11), string(xdDate:Today())) > 0

In fact this produces some odd results I can't explain.  This filters
out all dates that are After today, however reversing the formula or
adding a not() does not return the results I am looking for.

Please help if you can

-Justin
Kalyan G Reddy MVP (GGK Tech) - 26 Jul 2007 10:42 GMT
Hello

Please visit this site and see there are many examples on the date and time
difference
http://enterprise-solutions.swits.net/infopath2003/

Hope they come of some help to you.

Signature

Kalyan G Reddy - INFOPATH MVP 2007
http://www.ggktech.com

> I have seen this issue mentioned multiple times.  However it is my
> understanding after reading many, many posts that this should work,
[quoted text clipped - 27 lines]
>
> -Justin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.