Ray-
Yup. UNION causes the database engine to use indexes to weed out the duplicates. An index value cannot contain more than 256 characters, so any longer fields get truncated. UNION ALL just does a straight fetch from the two (or more) recordsets without using an index or doing any truncation. You'll find that DISTINCT also truncates for the same reason.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Oct 12, 2015, at 6:59 PM, rayfrew@gmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Hi everyone
I was trying to link 2 Outlook folders and create a merged view so that emails saved in the 2 folders could be viewed on a form. Using the wizard I created Outlook folders in Access as linked tables. My next step was to select the data using a union query e.g.
Select EmailFrom, EmailSubject, EmailMessage from table1
Union
Select EmailFrom, EmailSubject, EmailMessage from table2
sadly the EmailMessage content was truncated - yet the data was there.
By changing the query to Union All it solved the problem - all data present an correct. Three letters make all the difference.
Still learning.
Ray
__._,_.___
Posted by: John Viescas <johnv@msn.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar