XPath Date Comparison not working

J

JustinDevine

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top