Filters not working and Date Comparison Not working

J

JustinDevine

The InfoPath group has helped me with some pretty difficult InfoPath
problems in the past and I am hoping someone can lend their XPath Guru
knowledge to this one. You're my last hope, I am about to give up on
this being possible.

Heres the case:

I have two fields, populated by a SharePoint List (calendar). One
field being populated by the @Event and one by the @Begin date. I am
using the following filter to only display unique entries in the
@Event field as there are repetitive events.

not(@Event = preceding-sibling::dfs:OoA_Annoucements_and_Events/
@Event)

I am also filtering for another field @Type = "OoA Workshop" as I
only want to display certain types of events. This works fine.

The field populated by the @Begin values is then filtered by @Event =
my:Workshop. so basically the user selects a workshop from the first
field populated with workshop events and the dates that workshop is
offered are presented in the second field.

I was trying to find a way to compare a sharepoint date to the current
date and after hours and hours of failure I gave up and decided to
simply create a SharePoint field called "HasPassed" which would be
manually set by the users. So I am attempting to filter for HasPassed
= Yes with no success, any attempt to filter EITHER field for
HasPassed fails miserably in every way I can possibly imagine to try.
I am at a complete loss. I simply have no explanation why the first
filter on each field (@Type= "OoA Workshop" and @Event = my:Workshop)
works for each field however adding another filter, identical in form,
(sharepoint choice column being filtered for a particular value), to
either field fails.

So what i need is to understand WHY this second filter won't work on
EITHER field no matter what it is but the first one will OR a way that
actually works to filter a sharepoint date for "greater than today"
all my attempts at this have failed as well. SharePoint sends the
@Begin in the format YYYY-MM-DD 00:00:00 while infopath can provide a
date or datetime in YY-MM-DD or YY-MM-DDT00:00:00. All the following
methods have failed

number(translate(substring(., 0, 11), '-', '')) >=
number(translate( xdDate:Today(), '-', ''))
number(translate( xdDate:Today(), '-', '')) >= number(translate(.,
'-', ''))
msxsl:string-compare(number(translate(.,, '-', '',), xdDate:Today())
number(translate(substring(@Begin, 0, 11), "-", "")) >
number(translate(xdDate:Today(), "-", ""))
msxsl:string-compare(substring(@Begin, 0, 11), xdDate:Today()) > 0
msxsl:string-compare(translate(substring(., 0, 11), '-', ''),
translate(xdDate:Today(), '-', '')) > 0

I have pretty much spent the better part of two days on the simple
function of "if the date is greater than today filter out" and have
tried both filtering based on a manual field and xpath comparisons
both of which have ended in failure. Please help me out if you can.
Perhaps my limited knowledge of what goes on with XPATH behind the
scenes is preventing me from seeing an obvious flaw.

Thanks as always

-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