473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Creating a new table as a subset of two other tables

I am trying to create a table which is a subset of two other table
where those tables have the same uniquely identifying key. I am using
Access 2003.

The SQL statement that I am trying to use gets an automation error,
and I am not sure what part of the SQL code is causing them because I
don't know how to debug from the error statements that I get. Here is
the code:

CREATE TABLE subTable
AS (
SELECT *
FROM table1, table2
WHERE table1.cusip = table2.cusip)

cusip is the uniquely identifying key that each table contains. Can
anyone see what is causing the automation error?

Thanks,
Carter

Jun 29 '07 #1
1 2573
Since you have two tables, you need to specify the fields. Select table1.*,
table2.* From... However, you will probably get more fields than you want
that way, since you have the cusip field in both tables. Better to specify
the fields: Select table1.field1, table1.field2, table2.field1, etc.

Neil

<ca**************@citi.comwrote in message
news:11*********************@m36g2000hse.googlegro ups.com...
>I am trying to create a table which is a subset of two other table
where those tables have the same uniquely identifying key. I am using
Access 2003.

The SQL statement that I am trying to use gets an automation error,
and I am not sure what part of the SQL code is causing them because I
don't know how to debug from the error statements that I get. Here is
the code:

CREATE TABLE subTable
AS (
SELECT *
FROM table1, table2
WHERE table1.cusip = table2.cusip)

cusip is the uniquely identifying key that each table contains. Can
anyone see what is causing the automation error?

Thanks,
Carter

Jun 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
1
by: Greg | last post by:
How can I use a variable as the table name?
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
31
by: Neil | last post by:
I have an Access 2000 MDB with ODBC linked tables to a SQL Server 7 back end. I currently have a selections table in the front end file which the users use to make selections of records. The table...
1
by: Shelby | last post by:
Problem: My company generates its own data export from a propietary database. These (free) tables can be read in C#.NET using a Visual FoxPro driver (vfpoledb). I can read each of the six tables...
1
by: Phil Short via DotNetMonster.com | last post by:
I'm having trouble using a temp table in Oracle. Here's my code: Dim myConn As OleDbConnection Dim strconn As String = Session.Item("optSrcDBConnect") Dim dcSQL As OleDbCommand Dim strSQL As...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
4
by: louishong | last post by:
i'm uisng a master database that has hundreds of tables and links. i would like to create a clean mdb file and only import/link tables from the master database where the description column is like...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.