Solved

How to append records from one table to another with different data types for 1 field ?

Posted on 2007-04-02
1
199 Views
Last Modified: 2010-05-18
I am creating an Access application with Access as the front end and SQL Server as the back end database.

I have an existing table named tblA with 3 fields as follows:

field1 defined as int 4, Identity field
field2 defined as type float(8)
field3 defined as type nvarchar(10).

I have another table named table tblB with 2 fields as follows:
field2 defined as type nvarchar(9)
field3 defined as type nvarchar(10).

I want to append the records from table tblA into table tblB.
Do you know how I could accomplish this ?
0
Comment
Question by:zimmer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
dready earned 500 total points
ID: 18840727
Can you give some example data for both tables? Do you want to put the float values from tblA.field2 in tblB.field2, but then as nvarchar? IF this is the case, you could do the follwing:

INSERT INTO tblB(field2, field3)
SELECT cast(field2 as nvarchar(9)), field3 from tblA

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question