473,394 Members | 1,700 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,394 software developers and data experts.

Merge two table together

Okay, this is what I have so far.

I was trying to do a Union Query, this is the SQL information I have.
Expand|Select|Wrap|Line Numbers
  1. ELECT TRANSFORMERS.CoNo,
  2.        TRANSFORMERS.SerialNo,
  3.        TRANSFORMERS.KVA,
  4.        TRANSFORMERS.Mfg,
  5.        TRANSFORMERS.PriVoltsHigh,
  6.        TRANSFORMERS.PriVoltsLow,
  7.        TRANSFORMERS.SecVoltsHight,
  8.        TRANSFORMERS.SecVoltsLow
  9. FROM TRANSFORMERS INNER
  10. UNION ALL
  11. SELECT TRANSFORMERS.CoNo,
  12.        TRANSFORMERS.SerialNo,
  13.        TRANSFORMERS.KVA,
  14.        TRANSFORMERS.Mfg,
  15.        TRANSFORMERS.PriVoltsHigh,
  16.        TRANSFORMERS.PriVoltsLow,
  17.        TRANSFORMERS.SecVoltsHight,
  18.        TRANSFORMERS.SecVoltsLow
  19. FROM TRANSFORMERSNew;
I keep getting an error "Syntax error in JOIN operation"...did I miss something?
Help...
Dec 23 '08 #1
5 1721
ramprat
60
Could it be that the first word in your SQL statement says ELECT when it should say SELECT?
Dec 23 '08 #2
ChipR
1,287 Expert 1GB
INNER is the keyword for a type of JOIN. I've never heard of an INNER UNION ALL.
Dec 23 '08 #3
NeoPa
32,556 Expert Mod 16PB
Karyna,

Notice I reformatted the SQL code for you as well as adding the [ CODE ] tags. I wonder how so many members seem to expect us to be able to read their SQL when they just dump it in a mess without any sort of formatting. This takes no special expertise, simply a little time and effort. I don't mean to bust your chops on this, but I really just don't get how this happens so often. As this is your first post I won't make a big deal out of it (in truth I want to leave it for others to find as they search through, rather than direct it specifically at yourself).

If you re-examine it now, you will see a number of mistakes (especially if I point them out to you) :
  1. As mentioned before, the first character is missing from the SELECT on line #1.
  2. On line #9 there is the remnants of an INNER JOIN statement. I guess someone decided to use the UNION ALL instead but failed to clear away the INNER JOIN fully.
  3. The second SELECT query in the UNION (starting at line #11) refers to the wrong table. All the lines from #11 to #18 should be referring to TRANSFORMERSNew rather than TRANSFORMERS.

Welcome to Bytes!
Dec 23 '08 #4
I will make sure to put code in a proper format.

I do have the "S" in the code...but I did not realize that INNER was not needed.

Is there a specific book on queries in Access, that anyone can recommend.

Thank you to all who responded.

Merry Christmas!
Dec 24 '08 #5
MindBender77
234 100+
@karynaweiss
I would advise using Google to assist you. There is a plethora of information out there. Just search for: "Access Query Basics" for example.

Here is one to get started.
Query Basics

Hope this helps,
Bender
Dec 24 '08 #6

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

Similar topics

1
by: Diane Yocom | last post by:
I have an ASP intranet application that is required to produce Word documents merged with data from a database. I originally looked at automating Word's mail merge capabilities, but nixed that...
0
by: EasyRider41 | last post by:
I am trying to merge to scripting samples I for on a source code web site and having limited luck. Then first one is called Zebra Tables witch colors alternate rows of a table to look beter. The...
4
by: marklawford | last post by:
Hi guys, I'm getting the following error message when trying to run a MERGE statement I'm putting together. The syntax looks right to me But i must be missing something. The "srce" table...
0
by: Sheila | last post by:
I have set up a Word mail merge document of the type Directory which allows me to display all of the records on a single page rather than putting each record on a separate page. It uses a...
16
by: UDBDBA | last post by:
Hi All: I need some clarification on a MERGE statement. The database is on V8 FP12 (AIX) 64bit. The source table is tableA. The target is a View "FACT" with UNION ALL because of the 512 Gig...
6
by: crealesmith | last post by:
Firstly, I have no problem with mail merging to Word, VB code for that works perfectly. On one mail merge I need to merge 15 fields of data that are from 3 seperate records. The 3 records are all...
2
by: JK | last post by:
I saw Danny Lesandrini's article on Database Journal (http://www.databasejournal.com/features/msaccess/article.php/2236471) on how to merge tables from identical databases. This is exactly what...
1
by: barny | last post by:
Hi all, I have been trying to merge two access tables together all morning with no succsess. In table one I have Account Number|Return1|Return2|Return3| M1234567 | P9832 | Q1234 | P4322 |...
4
by: coolhand729 | last post by:
Okay, this is not your normal two table query (at least it doesn't seem that way to me). I'm using Access 2000 on Windows XP. I have two tables in access. One is a table with addresses of club...
3
by: acctman | last post by:
Hi i need help with a sql query. i have two tables Product and tblWebProduct, i need to merge the two tables together only copying the rows IF the stockcodes match (Product.StockCode &...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.