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

  • Home
  • SEARCH
  • 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 8499753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:45:13+00:00 2026-06-11T00:45:13+00:00

I want to Change Column data type from ‘VarChar’ to ‘DataType’ While inserting into

  • 0

I want to Change Column data type from ‘VarChar’ to ‘DataType’ While inserting into another table from Source Table

I am able to do it in T-SQL

Declare @DateTime   As      DateTime
Declare @Date       As      NVARCHAR(20)

Set @Date = '120901'
Set @DateTime = CONVERT(Date,'20'+SUBSTRING(@Date,1,2)+'-'+SUBSTRING(@Date,3,2)+'-'+SUBSTRING(@Date,5,2))
Print @DateTime

How can i implement it in insert Statement

Insert Into AxisReportMain 
Select (Column1,Column2,Column3)
From ReportMain

Column2 Contains Date as ‘VarChar’. In AxisReportMain table Column2 DataType is “Date”

  • 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-06-11T00:45:14+00:00Added an answer on June 11, 2026 at 12:45 am

    Try:

    Insert Into AxisReportMain 
    Select Column1,
           CONVERT(Date,'20'+SUBSTRING(Column2,1,2)+'-'+SUBSTRING(Column2,3,2)+'-'+SUBSTRING(Column2,5,2)) as Column2,
           Column3
    From ReportMain
    Where Column2 <> '000000'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change the data type of multiple columns from float to int.
i have a table column called status - data type is boolean. i want
I need to change the data type of a column from nvarchar(50) to nvarchar(MAX).
I want to change the type of a column in MS SQL Server 2005,
I would like to change a column in SQL Server from type int, to
I have RowDatabound event where I want to change column names like this: Protected
I'm working with MS SQL SERVER 2003. I want to change a column in
RODBC is the main library in R to import data from a database into
I want to copy tabular data to Excel from my app. The most simple
I have premiere_poland column in database table which is date type. /** @Column(type=date, nullable=TRUE)

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.