<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h2
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:14.0pt;
font-family:Arial;
font-style:italic;}
h3
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:13.0pt;
font-family:Arial;}
h4
{margin-top:3.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:12.0pt;
font-family:Arial;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.Code, li.Code, div.Code
{margin-top:6.0pt;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:17.85pt;
punctuation-wrap:simple;
text-autospace:none;
font-size:12.0pt;
font-family:"Courier New";}
span.EmailStyle18
{font-family:Arial;
color:navy;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>To which I would add, this is a risk of
SELECT *. Downstream you may one day decide to change the structure of one of
the tables, inserting a new column. This would break any UNION statement, since
the tables would no longer match. </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I have learned the hard way to avoid
SELECT * like the plague. Ask for exactly what you want, and ye shall get it </span></font><font
size=2 color=navy face=Wingdings><span style='font-size:10.0pt;font-family:
Wingdings;color:navy'>J</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
accessd-admin@databaseadvisors.com [mailto:accessd-admin@databaseadvisors.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Hollis,Virginia<br>
<b><span style='font-weight:bold'>Sent:</span></b> February 8, 2003 9:46 AM<br>
<b><span style='font-weight:bold'>To:</span></b> 'accessd@databaseadvisors.com'<br>
<b><span style='font-weight:bold'>Subject:</span></b> [AccessD] Learned
Something Today</span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I learned something today that most
of you probably already know, but just in case I thought I would pass it along
- especially since it took me 2 days to figure out what I was doing wrong.</span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I created a Union query using SELECT
* from both tables. The Union query worked when I viewed it, but when I tried
using it to create a report & joined it to the evaluator table, I
kept getting a type mismatch in join. The main table had the EvaluatorID as a
number & the Evaluator table had EvaluatorID as autonumber (the tables were
joined by EvaluatorID). So there should not have been any problem. All the
other joins worked fine.</span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>So after eliminating all the
possible combinations and trying different tables I compared the 2 tables used
in the Union to see if one of the fields might have been wrong. Here is where
the learning comes in! The table fields have to be in the same Order. In one
table I had EvaluatorID listed 3rd in the list & the other it was 2nd.</span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Another way I found this is that I
switched the order of the tables in the query, SELECT * from table 1 UNION ALL
table 2. When I did SELECT from table 2 UNION ALL table 1, I had text in the
EvaluatorID field.</span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Just thought I would pass that
along.</span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Virginia</span></font></p>
</div>
</div>
</body>
</html>