I created a Infopath 2007 form linked to a SQL 2005 database table.
SQL Table creation script :
CREATE TABLE [dbo].[Cout](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[Qte] [float] NULL,
[PU] [float] NULL,
[Kamount] [float] NULL,
CONSTRAINT [PK_Cout] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
After disposing the data fileds as a table, I put the folowing formula as
default value for the Kamount field : "(@Qte * @PU) * .001"
When I run and post the form :
Qte = 1, PU = 100 000, result : KAmount = 100
Qte = 0.01, PU = 100 000, result : KAmount = 1
Qte = 0.03, PU = 100 000, result : KAmount = NaN
Can somebody explain to me the NaN result ?
NB : This occurs as well whith InfoPath 2003 and SQL 2000
Thank's
Arsenio Locsin - 20 Mar 2008 21:57 GMT
> When I run and post the form :
> Qte = 1, PU = 100 000, result : KAmount = 100
> Qte = 0.01, PU = 100 000, result : KAmount = 1
> Qte = 0.03, PU = 100 000, result : KAmount = NaN
>
> Can somebody explain to me the NaN result ?
NaN means "Not a Number" or that the result is not recognized by InfoPath as
a number. For example, if you have a formula that multiplies a field
containing a number with a field containing text, the result would be NaN.
See if your calculation is not using or results in a value that isn't a
number.
Edouard LECOQ - 21 Apr 2008 11:08 GMT
Thank's for answer.
I know that NaN means not a number, but in the precise case I wrote, I do
not understand why, in the second and third cases, the result of 0.01 *
100000 / 1000 gives a number and the same operation with 0.03 instead of 0.01
gives NaN.
> > When I run and post the form :
> > Qte = 1, PU = 100 000, result : KAmount = 100
[quoted text clipped - 9 lines]
> See if your calculation is not using or results in a value that isn't a
> number.