Link to home
Start Free TrialLog in
Avatar of pa_gmbh
pa_gmbh

asked on

XPath / Rules in InfoPath 2010

Hello Guys,

i got a little problem with InfoPath 2011, i want to check the day of the week with the function xdDate:Today().

Unfortunatly rules i append, to check if the day either starts with monday or tuesday ALWAYS fail. I really don't have a clou why this happens, cause it seems pretty clear on first sight, but it wont work for me?

Any Ideas on this behavior?
Avatar of McOz
McOz

The reason checking for "Monday" or "Tuesday" always fails is because Today() does not return the name of the day, it returns a date in the format "2011-03-14".

There is no easy way to get the day name, but you can do it with code. See this link for an example of how this is done:

http://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/94cab487feadc280/bf23d09bd5fbe274?lnk=raot&pli=1

Good luck!
pa_gmbh, I did a little more looking around for a date-to-day formula in infopath. Here's a way to get it *without* code:

http://blueinfopath.wordpress.com/2009/11/22/weekday-name-function-in-infopath/

Hope it helps!
Avatar of pa_gmbh

ASKER

I did it with the attached file.

Works very well!
ASKER CERTIFIED SOLUTION
Avatar of pa_gmbh
pa_gmbh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pa_gmbh

ASKER

this is a testtemplate to test the form.

It`s works perfectly!