View Full Version : SQL Union Question

01-10-2007, 01:27 PM
This code worked perfectly fine in Access but when i run it from SQL i get the error?

Microsoft OLE DB Provider for SQL Server error '80040e14'

The text, ntext, or image data type cannot be selected as DISTINCT.

SELECT UName_E AS Term_e, UAbbr_E AS Desc_e, 1 AS TableName FROM UnitNames Union SELECT ProductName AS Term_e, ProductDesc AS Desc_e, 2 AS TableName FROM Equip_ProductName

01-10-2007, 09:15 PM
Are the columns you select from the two tables of the same datatype? I remember SQL had a problem doing a union when the datatypes of the columns don't match

01-12-2007, 02:46 PM
Try using UNION ALL