Database field type of digital currency
access allows nine data types: text, remarks, numeric value, date / time, currency, auto numbering, yes / no, OLE object, hyperlink and Query Wizard. In the design view of a table, each field has a design type
text: this type allows a maximum of 255 characters or numbers. The default size of access is 50 characters, and the system only saves the characters entered into the field, not the empty characters in the unused position in the text field. You can set the field size property to control the maximum length of characters that can be entered
note: this type is used to store long text and numbers. It allows fields to store up to 64000 characters. But access can't sort or index the memo field, but it can sort and index the text field. Although the text can be searched in the note field, it is not as fast as in the indexed text field
number: this field type can be used to store digital data for arithmetic calculation. Users can also set the "field size" attribute to define a specific number type. Any font type specified as a digital data type can be set to "byte", "integer", "long integer", "single precision number", "double precision number", "synchronous ID", etc There are five types of decimal. In access, the default is double
date / time: this type is used to store date, time or date time together. Each date / time field needs 8 bytes of storage space.
Currency field types generally include int, float, money / smallmoney, decimal / numeric
select according to the accuracy of the stored data:
int can only store integer money
Themoney / smallmoney data types are accurate to one ten thousandth of the monetary unit they represent
decimal / numberic can customize the decimal places and the data precision that can be stored, so generally more people use this type
float is not suitable for currency which needs precise value
conclusion:
it is best to use money and decimal types in finance
if it is a simple calculation, the float type can be used, but the data fetched by the float type on some platforms is not so accurate, and the accuracy may be lost. Therefore, if the cost is not great in a stable performance platform, it is recommended to use the above two types
extended data:
SQL data type:
1, bit integer
bit data type is integer, its value can only be 0, 1 or null. This data type is used to store data with only two possible values, such as yes or no, true or false, on or off.
note: it is a data type that saves a lot of space. If it can meet the requirements, it should be used as much as possible
The 2, tinyint integer
tinyint data type can store integers from 0 to 255. It's useful when you're only going to store a limited number of values. This data type occupies 1 byte in the database
The 3, smallint integer
smallint data type can store integers from the 15th power (- 32768) of - 2 to the 15th power (32767) of 2. This kind of data type is very useful for storing some numerical data which is often limited in a specific range. This data type takes up two bytes of space in the database
The4, int integer
int data type can store integers from the 31st power of - 2 (- 2147483648) to the 31st power of 2 (2147483647). Almost all numerical data stored in the database can use this data type. This data type takes up four bytes in the database
The5, decimal precise numerical type
decimal data type can be used to store numerical data with fixed precision and range from - 10 to - 10. When using this data type, you must specify the range and precision. The range is the total number of digits that can be stored around the decimal point. Precision is the number of digits stored to the right of the decimal point
Numerical data type is similar to decimal7, smallmoney
smallmoney data type is used to represent money and monetary value. This data type can store data from - 214748.3648 to 214748.3647, accurate to one ten thousandth of the monetary unit
8, money type
money data type is used to express money and monetary value. This data type can store data from - 922 billion to 922 billion, accurate to one ten thousandth of the monetary unit
9, float approximate value type
float data type is an approximate value type for floating-point numbers. Floating point numbers are approximate because not all numbers in their range can be expressed accurately. Floating point numbers can be any number from - 1.79e + 308 to 1.79e + 308
10, real approximate value
real data type is similar to floating-point number, it is approximate value type. It can represent floating-point numbers with values between - 3.40e + 38 and 3.40e + 38
Settings
description
examples
regular numbers (default values) display the input numbers as they are. 3456.789
thousand separator is used for currency; For negative number, decimal, currency symbol and decimal point position, follow the settings in Windows control panel. ¥ 3457
the euro uses the euro symbol (#8364;), The currency symbol specified in Windows regional settings is not considered 8364; 3456.79
at least one digit will be displayed. For negative numbers, decimals, currency symbols and decimal places, follow the settings in the windows "control panel". 3456.79
the standard uses thousands separator; For negative numbers, decimal symbols, and decimal point positions, follow the settings specified in the windows locale. 3456.79
percent multiplied by 100 plus percent sign (%); For negative number, decimal, currency symbol and decimal point position, follow the settings in Windows control panel. 123.00%
the standard scientific counting method was used. 3.46E+03