Have you ever wonder what is the Data Types In MS Access? Data Types is the classifications that define the value of the field (or variable) in programming. In Access, the data type is same with SQL language for database or Visual Basic for VBA code.
In Access, you can set the data type in the field. Open the table and go to Design view. After you input the field name, you can select the data type.
|Short & Long Text||alphanumeric values in text. The difference is in the character length.|
|Number||Numeric values. It is a separate data type for currency.|
|Date/Time||Contains the Date (Day, Month, Year) and Time (hour, minute, second) value.|
|AutoNumber||The unique value generated by Access for each new record.|
|Yes/No||Only contains Yes or No Value|
|OLE Object||Pictures, graphs, or other ActiveX objects from another Windows-based application.|
|Hyperlink||Text or combinations of text and numbers stored as text and used as a hyperlink address.|
|Attachment||Attached images, spreadsheet files, documents, and other types of supported files to the records in your database.|
|Calculated Field||Results of a calculation which refer to other fields in the same table. You need Expression Builder to create the calculation.|
|Lookup||Displays either a list of values that is retrieved from a table or query. For more information, read LookUp Wizard Tutorial.|
The data type determine the value stored and displayed in the fields. In the field properties, in General tab, you can set the Field Size and Format. The example is in Date/Time, you can select the format into ShortDate (MM/DD/YYYY), Medium Date (DD-MMM-YY) or LongTime (HH:MM:SS AM/PM).
However, when you enter the query, macros, and modules, the Data Type will follow the SQL data type. The data type is really useful in programming. Here are some of most popular data type in Access and SQL database.
|VARCHAR||Character string with variable value|
|INTEGER||Number. No decimal.|
|DATE||Stores year, month, and day values|
You can see the example of data type in Access programming in the picture below.