Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:18:51+00:00 2026-05-30T23:18:51+00:00

How can we explicitly convert data types in INSERT INTO/SELECT queries in MS Access?

  • 0

How can we explicitly convert data types in INSERT INTO/SELECT queries in MS Access?

Sample Query:

INSERT INTO pStudents( pStudentID, pDate, pRate, pGrade )
SELECT sStudentID, sDate, sRate, sGrade
FROM sStudents
WHERE (((sStudents.sStudentID) Is Not Null);

Here I want to convert fields from sStudents table before inserting in pStudents to following:

pStudentID = text
pDate = Short Date
pRate = Double
pGrade = text

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:18:52+00:00Added an answer on May 30, 2026 at 11:18 pm

    You can use the built-in conversion functions of Access in the queries:

    Select CStr(NumericColumn) from Table
    

    …or as an INSERT query:

    Insert Into AnotherTable (StringColumn)
    Select CStr(NumericColumn) from Table
    

    Did you mean something like that?


    EDIT:

    Okay, your sample query with conversions would look like this:

    INSERT INTO pStudents( pStudentID, pDate, pRate, pGrade )
    SELECT CStr(sStudentID), CDate(sDate), CDbl(sRate), CStr(sGrade)
    FROM sStudents
    WHERE (((sStudents.sStudentID) Is Not Null);
    

    However, this will only work if the columns contain only data that can actually be converted into the given type.

    For example, you can convert a String column to Double with CDbl() – but only if the selected rows contain only values that can actually be converted into Double.
    As soon as you select one row with a value that contains something else than numeric values (like ‘hello’), the conversion will fail.

    On the other hand, do you really need the conversions?
    Access can convert a lot by itself. For example, you can insert values from a numeric column into a string column, Access will convert it by itself. You don’t have to use CStr() for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know we can explicitly call the constructor of a class in C++ using
Can I call constructor explicitly, without using new , if I already have a
After creating a instance of a class, can we invoke the constructor explicitly? For
SELECT CONVERT(LAST_INSERT_ID(), SIGNED INTEGER); MySqlCommand.ExecuteScalar() and MySqlDataReader.GetValue(int index) both return and object type. I
I'm trying to convert a standard SQL query to a LINQ to SQL query.
I've written some simple code which interfaces with HandbrakeCLI to convert a video into
Unfortunatelly Thinking Sphinx can't simply convert time field to attribute class Place << ActiveRecord::Base
Back to the basics... For reference types, one can do this: SomeType someObject =
I know that we can define the key explicitly using the below line. For
I want to convert between various integral types; for example Word32 and Word8. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.