473,405 Members | 2,354 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.

Make a Table from a Query (SQL View)

f430
43
i have created a query using the sql view, and want to make this query a table. is there any way i can do that. i have tried clicking on query-make table query, but this takes me to the design view and it completely neglects what i had in sql view.

Thanks
Aug 17 '10 #1

✓ answered by dsatino

Ah, you can't view a Union query in design view. If you're UNION query is returning results without a problem, then just save it and build a new query from it. This new query will be viewable in design view and you can use the make-table functionality

11 2813
dsatino
393 256MB
So you want to make a table based on the results of a SELECT query?
Aug 17 '10 #2
OldBirdman
675 512MB
Using Access 2003, I created a SELECT query in SQL view. I then clicked Query->Make-Table query... and Access switched to design view, correctly filling in the grid from my SQL view.
I was presented with a dialog asking for a new table name, and whether to create in this database or another.
I gave a name and chose current database. I was left in design view.
Changing to SQL view, my SQL statement was now altered correctly to a make-table query.

What happened when you clicked Query->Make-Table query...?
Aug 17 '10 #3
f430
43
when i click query> make table query access switches to design view, but the grid is empty, and has no fields filled out
Aug 18 '10 #4
OldBirdman
675 512MB
Further testing (Access 2003)
If the SQL can be represented in GridView, Access will do so when Make-Table selected.
If the SQL cannot be represented (i.e. UNION QUERY), the GridView selection is greyed-out (Enabled=False).
But if I press Make-Table in any case, I get a dialog asking for the new table name.
I cannot think of any SQL statement, with or without errors, where Access does not somehow respond either with a filled-in grid or a dialog box asking for further information.
Maybe if I had more information, such as the SQL statement as shown in SQL View, I might be able to help you. Otherwise I can offer no further assistance.
Aug 18 '10 #5
dsatino
393 256MB
Quick guess: Your source table name is misspelled.
Aug 18 '10 #6
f430
43
here is my sql code, i wasnt able to get it to work
Expand|Select|Wrap|Line Numbers
  1. SELECT   [Part Number], [Code 1], [Quantity 1]
  2. FROM     [Master Table]
  3. WHERE  (([Code 1] IS NOT Null)
  4. OR   ([Quantity 1] IS NOT Null))
  5. UNION ALL
  6. SELECT   [Part Number], [Code 2] AS [Code 1], [Quantity 2] AS [Quantity 1]
  7. FROM     [Master Table]
  8. WHERE  (([Code 2] IS NOT Null)
  9. OR   ([Quantity 2] IS NOT Null))
  10. UNION ALL
  11. SELECT   [Part Number], [Code 3] AS [Code 1], [Quantity 3] AS [Quantity 1]
  12. FROM     [Master Table]
  13. WHERE  (([Code 3] IS NOT Null)
  14. OR   ([Quantity 3] IS NOT Null))
  15. ORDER BY [Part Number];
  16.  
Aug 18 '10 #7
dsatino
393 256MB
Ah, you can't view a Union query in design view. If you're UNION query is returning results without a problem, then just save it and build a new query from it. This new query will be viewable in design view and you can use the make-table functionality
Aug 18 '10 #8
dsatino
393 256MB
Oh, and I think your confusing it by trying to name your fields as preexisting field names. The column names will be pulled from the first query in the union, so you probably don't have to rename the columns in the rest of queries
Aug 18 '10 #9
f430
43
it worked.
Thanks
Aug 18 '10 #10
dsatino
393 256MB
No problem. I don't write a lot pure SQL, so this is more for my own info. Were there any issues with column names you gave to the second and third select queries in the UNION?
Aug 18 '10 #11
NeoPa
32,556 Expert Mod 16PB
For those of you relatively new to working directly in SQL (I expect the OP is already happy with his solution but you're also welcome to the knowledge of course), UNION queries (or any type of query that makes sense, but which Access doesn't handle in Design View) can also be handled, directly in SQL, by encapsulating it within a Sub Query (Subqueries in SQL).
Aug 24 '10 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to use a make table query to pull the last transactionID, so I can use an append query to reset the transactionID to the next...
4
by: Oreo Bomb | last post by:
I have a secured database that contains a Read-Only group. This group has permissions to view reports, but cannot add, edit, or delete any DB objects. One of the reports the group needs access to...
2
by: Dragon | last post by:
When I run a make-table query, the results take over 1 minute to return. The query is making a table that has 12,000 records in it. If I run the make-table query ONLY to see the records that will...
2
by: Doc | last post by:
Per earlier post, I am trying to save 'out' production data from a program called Solomon - basically (I think) this was /is an Access/Sql based program. We are updating to different application...
20
by: Neil Robbins | last post by:
I am trying to execute a make table query in my vb.net program. The db that I am accessing is an Access 2000 format db. The SQL code that I am using has been cut and pasted from the SQL View having...
4
by: ken | last post by:
Hi, I use this command to run a make table query without opening it... CurrentDb.Execute "make table query name" Access tells me that it can't execute a select query...? Its a make table query...
27
by: MLH | last post by:
How can I turn the following into a make-table query? SELECT & " " & AS Recipient FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID WHERE...
5
by: vegak18 | last post by:
Dear Experts, I was was wondering if there was some way to specify output properties of a make table query. Specifically, I am haivng a problem with numbers being specified as text. while I...
9
by: Mourad | last post by:
Hi All, Is it possible to create a Make Table query in access (2.0 and 2003) that creates the table into a SQL Server database? Following the steps: 1- Create New Query 2- Set Query Type as...
2
by: Laurel | last post by:
I am completely new to access. I have a make-table query that combines data from two/more tables, asks for a criteria, deletes the old table and produces a new table every time under the same name....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.