Re: Select SQL money field incorrect large negative values
- From: "Ken Conner" <Ken Conner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Mar 2005 23:23:01 -0800
The problem is in the cursor services, use server side cursors and it
dissappears. The variable it is stored in is not the problem, it is
definately a bug in the library.
It also does not apply to larger neg numbers, only to ones within a certain
range
"Kent2004" wrote:
> The field is 'money'. This has been working for several years on
> Windows2000. Encountered the problem after moving the application to new
> servers running Window Server 2003. My solution, which works ok is the
> following:
>
> My solution is this:
>
> Database: Change amt field datatype to decimal Precision 20, Scale 4
> Scripts: Change variable: intAmtSGL = CCur(rsFACTS("amt"))
>
> --Kent Smith
>
> "Michael Harris (MVP)" wrote:
>
> > Kent2004 wrote:
> > > A production application using VBScript and SQL Server 2000 formats
> > > incorrect value for a selected money field. Values between
> > > -200,000,000,000 and -455,000,000,000 are displayed incorrectly using
> > > formatcurrency. The values are correct in the database. The
> > > application works correctly in Windows 2000 but fails in Windows
> > > Server 2003.
> >
> > What is the data type of the amt field as defined in the database?
> >
> > Those values are clearly too big to be integers or even longs. They are in
> > the range of doubles.
> >
> > Have you tried an explicit CDbl(rsFACTS.Fields.Item("amt").Value) ???
> >
> >
> > >
> > > app code:
> > > ...
> > > strQry = "SELECT fielda, fieldb, amt, ....,
> > > Set rsFACTS = oFACTS.Execute(strQry)
> > > ...
> > > intAmtSGL = rsFACTS("amt")
> > > ...
> > > %><td width="21%" align="right" ><%=formatcurrency(intAmtSGL)%></td><%
> > > ...
> > > Field amt = -216556000000 - - ok in database (Viewed via Enterprise
> > > Manager) Displays as $36,376,018,631.48
> > >
> > > If for example, I update DB with amt = -255000000000
> > > it displays as $29,820,018,631.48
> > >
> > > ???
> >
> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > Sammamish WA US
> >
> >
.
- Prev by Date: Re: How can i get dynamically properties of AD Objects with WMI
- Next by Date: Logon Scripts over VPN connections
- Previous by thread: Re: How can i get dynamically properties of AD Objects with WMI
- Next by thread: Logon Scripts over VPN connections
- Index(es):
Relevant Pages
|