Fractional cents in Currency fields? Why?

Fractional cents in Currency fields? Why?

Post by Brian » Fri, 05 Jun 1998 04:00:00



For some reason I've been getting odd results on financial queries in one
of my databases.

When I run a query like this:

SELECT InvoiceID, Balance
FROM Invoices
WHERE Balance > 0.00 AND Balance < 0.01

I get rows back that show a Balance of 0.00.  It appears that the
database is somehow storing fractional values in the Currency field.

Why and how?

This is occurring in SQL6.5 in the Small Business Server.

Any help greatly appreciated!

        Thanks Muchly,

        - Brian G.

 
 
 

Fractional cents in Currency fields? Why?

Post by Brian K. Lawto » Fri, 05 Jun 1998 04:00:00


From books on-line...

money
Is a datatype that stores monetary values from -922,337,203,685,477.5808
through +922,337,203,685,477.5807, with accuracy to a
ten-thousandth-of-a-monetary-unit. Money values are represented as
double-precision integers. Storage size is 8 bytes.

________________________________________________________

RDA Consultants Limited (http://www.RDAConsultants.Com)


>For some reason I've been getting odd results on financial queries in one
>of my databases.

>When I run a query like this:

>SELECT InvoiceID, Balance
>FROM Invoices
>WHERE Balance > 0.00 AND Balance < 0.01

>I get rows back that show a Balance of 0.00.  It appears that the
>database is somehow storing fractional values in the Currency field.

>Why and how?

>This is occurring in SQL6.5 in the Small Business Server.

>Any help greatly appreciated!

> Thanks Muchly,

> - Brian G.