...

View Full Version : SQL Union Question



tcadieux
01-10-2007, 02: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

Roelf
01-10-2007, 10: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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum