Solved

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

Posted on 2007-04-02
1
196 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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