Re: Select SQL money field incorrect large negative values

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
> >
> >
.



Relevant Pages

  • Create SharePoint Portal failed.
    ... One mentioned ensuring that SQL Server uses a case ... 13:55:40 Service database server is 'USDC-JOHRIV'. ... Update dbo.propertylist set DisplayName = N'Last name' ...
    (microsoft.public.sharepoint.portalserver)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)
  • Re: TNS could not resolve the connect identifier
    ... This database resides on Machine A. ... The Web server is running on Machine B. ... Using tnsping is not as good as using a real connection such as via ... client (note that this is terminology that appears in the 10g R2 ...
    (comp.databases.oracle.server)
  • Config for OLTP system
    ... extrenal disks fo the 60GByte database server. ... IBM Informix Dynamic Server Configuration Parameters ... # BUFFSIZE - OnLine no longer supports this configuration parameter. ...
    (comp.databases.informix)