Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2008

Tip: Looking for answers? Try searching our database.

NaN in calculated field whith Infopath form linked to SQL Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edouard LECOQ - 11 Mar 2008 11:07 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.