![]() | ![]() |
Home |
|
|
Reference Manual |
|
| Chapter 1: System and User-Defined Datatypes |
|
| Standards and Compliance |
|
| Money Datatypes |
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.
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.
Table 1-11 summarizes the range and storage requirements for money datatypes:
Datatype | Range | Bytes of Storage |
|---|---|---|
money | Monetary values between +922,337,203,685,477.5807 and | 8 |
smallmoney | Monetary values between | 4 |
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.
Standard | Compliance Level |
|---|---|
SQL92 | The money and smallmoney datatypes are Transact-SQL extensions. |
|
|