Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Help With using a value from a field in an expression

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Help With using a value from a field in an expression
Aj 17.07.2006 18:23:02
So i am trying to do a division, by taking a value from a drop down field and
using it within an expression field in a formula ...
(substring(my:field1, 0, 4)/(12))..so I am extracting the first 4 characters
of the string which is a number such as 1.0 and diving that by 12. It gives
me the following error :

Node Test Expected.
substring(my:field1,0,4)/->12<-

I understand this might be due to the fact that I am taking a
string(although its a number) and diving that by a number?
Your assisstance is much appreciated.
RE: Help With using a value from a field in an expression
S.Y.M. Wong-A-Ton 17.07.2006 19:38:03
Use the number() function around the substring() expression to make sure that
you're dealing with a number. I think the zero in your substring expression
should be a 1. Furthermore, if you have the XPath Advanced checkbox on use
div instead of a slash. Make sure you enter spaces around the slash (I've
found this to solve such errors in the past).
---
S.Y.M. Wong-A-Ton


"Aj" wrote:

[Quoted Text]
> So i am trying to do a division, by taking a value from a drop down field and
> using it within an expression field in a formula ...
> (substring(my:field1, 0, 4)/(12))..so I am extracting the first 4 characters
> of the string which is a number such as 1.0 and diving that by 12. It gives
> me the following error :
>
> Node Test Expected.
> substring(my:field1,0,4)/->12<-
>
> I understand this might be due to the fact that I am taking a
> string(although its a number) and diving that by a number?
> Your assisstance is much appreciated.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net