Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Approximate Numeric Datatypes [Table of Contents] Timestamp Datatype

Reference Manual

[-] Chapter 1: System and User-Defined Datatypes
[-] Standards and Compliance
[-] Money Datatypes

Money Datatypes

Function

Use the money and smallmoney datatypes to store monetary data. You can use these types for U.S. dollars and other decimal currencies, but Adaptive Server provides no means to convert from one currency to another. You can use all arithmetic operations except modulo, and all aggregate functions, with money and smallmoney data.

Accuracy

Both money and smallmoney are accurate to one ten-thousandth of a monetary unit, but they round values up to two decimal places for display purposes. The default print format places a comma after every three digits.

Range and Storage Size

Table 1-11 summarizes the range and storage requirements for money datatypes:

Table 1-11: Money datatypes

Datatype

Range

Bytes of Storage

money

Monetary values between +922,337,203,685,477.5807 and
-922,337,203,685,477.5808

8

smallmoney

Monetary values between
+214,748.3647 and -214,748.3648

4

Entering Monetary Values

Monetary values entered with E notation are interpreted as float. This may cause an entry to be rejected or to lose some of its precision when it is stored as a money or smallmoney value.

money and smallmoney values can be entered with or without a preceding currency symbol, such as the dollar sign ($), yen sign (¥), or pound sterling sign (£). To enter a negative value, place the minus sign after the currency symbol. Do not include commas in your entry.

Standards and Compliance

Standard

Compliance Level

SQL92

The money and smallmoney datatypes are Transact-SQL extensions.


Approximate Numeric Datatypes [Table of Contents] Timestamp Datatype