Lesson 13 of 50 – Data Types in MS Access
26%

Data Types in MS Access

A data type determines what kind of information a field can store in a Microsoft Access table. Choosing the correct data type helps maintain accurate data and perform suitable operations.

1. What Is a Data Type?

A data type defines the type of value that can be stored in a field.

Examples:

  • StudentName — Short Text
  • AdmissionDate — Date/Time
  • FeesPaid — Currency
  • IsActive — Yes/No
  • StudentID — AutoNumber

For example, the StudentName field stores text, while AdmissionDate stores a date or time value.

2. Short Text

Short Text stores text and characters, such as names, addresses, phone numbers, and codes. In modern Access, a Short Text field can store up to 255 characters.

Examples:
  • Rahul Kumar
  • ADCA
  • Patna, Bihar
  • 9876543210
  • STU001

Common uses:

  • Student names
  • Mobile numbers
  • Email addresses
  • Course names
  • Postal codes

Phone numbers should generally use Short Text because they are identifiers, not values used for arithmetic.

3. Long Text

Long Text stores longer descriptions, comments, notes, and other extended text information.

Examples:
  • Student address details
  • Employee remarks
  • Course descriptions
  • Customer feedback

Use Long Text when the information may be longer than a normal Short Text field can accommodate.

4. Number

Number stores numeric values that may be used in calculations. The available field size determines the range and precision of the values.

Examples:
  • Quantity = 25
  • Marks = 85
  • Age = 20
  • Discount percentage = 10

Common uses:

  • Quantities
  • Marks
  • Measurements
  • Values used in calculations

Do not use Number for phone numbers or postal codes because these values are usually identifiers rather than quantities.

5. Date/Time

Date/Time stores date and time values. It can be used to record when an event occurred.

Examples:
  • Admission date
  • Payment date
  • Employee joining date
  • Appointment time

Example values:

  • 11/10/2026
  • 25/12/2026
  • 10:30 AM

The displayed format depends on the field format and regional settings. Use date values rather than text when you need date comparisons and calculations.

6. Currency

Currency stores monetary values and is designed for financial calculations.

Examples:
  • Course fee = ₹10,000
  • Fees paid = ₹5,000
  • Pending fee = ₹2,500
  • Product price = ₹799.50

Common uses:

  • Course fees
  • Salary amounts
  • Payments
  • Outstanding balances

Currency helps represent monetary amounts consistently. The currency symbol displayed depends on formatting and regional settings.

7. AutoNumber

AutoNumber automatically generates a value for each new record. It is commonly used to create a unique record ID.

Example:
StudentID StudentName
1 Rahul Kumar
2 Priya Kumari
3 Amit Kumar

When you add another record, Access generates its AutoNumber value automatically.

AutoNumber values are not guaranteed to be continuous or reused after a record is deleted.

8. Yes/No

Yes/No stores a logical value with two states, such as Yes or No, or True or False.

Examples:
  • IsActive — Yes/No
  • PaymentCompleted — Yes/No
  • AssignmentSubmitted — Yes/No
  • IsPresent — Yes/No

This data type is useful when a field represents a simple two-state condition.

9. Other Useful Data Types

Hyperlink

Stores hyperlinks to websites or other supported destinations.

Example: https://example.com

Attachment

Allows files to be attached to a database record.

Example: A document attached to a student record.

Calculated

Calculates a value using an expression based on other fields in the same table.

Example: TotalAmount = Quantity × Price.

Lookup Wizard

Helps create a field that selects values from a list or another data source. It is a field-design wizard, not a separate stored data type.

OLE Object

An older Access field type for embedding or linking supported objects. For many modern applications, Attachment or an external file reference may be more appropriate.

10. Data Types Comparison Table

Data Type Purpose Example
Short Text Short text and identifiers Rahul
Long Text Long descriptions Student remarks
Number Numeric calculations 85
Date/Time Dates and times 11/10/2026
Currency Financial amounts ₹5,000
AutoNumber Automatically generated IDs 101
Yes/No Two-state values Yes
Hyperlink Links Website URL
Attachment Files associated with records PDF document
Calculated Values calculated from expressions Quantity × Price

11. How to Change a Field's Data Type

  1. Open the database in Microsoft Access.
  2. Right-click the required table in the Navigation Pane.
  3. Select Design View.
  4. Select the field whose data type you want to change.
  5. Open the Data Type dropdown.
  6. Select the appropriate data type.
  7. Save the table.

Important: Changing a field's data type can cause data conversion problems or data loss. Back up the database and check existing values before making major changes.

12. Practical Assignment

Create a table named Students with these fields:

Field Name Required Data Type
StudentID AutoNumber
StudentName Short Text
Mobile Short Text
AdmissionDate Date/Time
CourseFee Currency
IsActive Yes/No
Remarks Long Text

Tasks:

  1. Create the table in Design View.
  2. Select the correct data type for each field.
  3. Set StudentID as the primary key.
  4. Save the table.
  5. Enter five sample records.
  6. Verify that the fields store appropriate values.

13. Revision Questions

  1. What is a data type?
  2. What is Short Text used for?
  3. What is the difference between Short Text and Long Text?
  4. Which data type is suitable for course fees?
  5. Which data type is used for dates?
  6. What is the purpose of AutoNumber?
  7. When should you use Yes/No?
  8. Why should mobile numbers generally be stored as Short Text?
  9. What is the purpose of the Attachment data type?
  10. How can you change a field's data type?

🧠 Quick Quiz

1. Which data type is suitable for a student's name?




2. Which data type is suitable for storing course fees?




3. Which data type automatically generates values for new records?