Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

'80040e14' The text, ntext, or image data type cannot be selected as DISTINCT. (None of the Fields Are?)

Hello All;

 I receive the following error through my ASP page.
==============================================
Microsoft OLE DB Provider for SQL Server error '80040e14'

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

/BS/Connections/i_utils.asp, line 51
==============================================

This is the code:
==============================================
==============
sSQL = "SELECT distinct A.*, B.CatID, B.Cat, " & _
        " (SELECT COUNT(1) FROM Cats WHERE A.CatTypeID=Cats.CatTypeID) AS ParentCount, " & _
        " (SELECT COUNT(1) FROM Content WHERE B.CatID=Content.CatID) AS ChildCount " & _
        " FROM (CatTypes A LEFT JOIN Cats B ON A.CatTypeID = B.CatTypeID) " & _
        " LEFT JOIN Content C on B.CatID = C.CatID " 
Srs.Open sSQL, Bconn, 1, 3, 1      ' Line 51 is here
==============
==============================================
The FieldName and Data Types are:
CatID = bigint
CatTypeID = int
Cat = varchar

=======
As you can see, none of the Field's Data Types are of "text, ntext (or) Image"

Any idea's on this one?

Thanks All;
Carrzkiss
ASKER CERTIFIED SOLUTION
Avatar of MikeWalsh
MikeWalsh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
script your CatTypes table and show it here. I bet you will see the column right there.
Avatar of Wayne Barron

ASKER

Oh man. That was sweet.

So it was looking at the entire Table of CatTypes. since it was the a.*
I will be darn,
Thanks a bunch.
It was the
CatType - text
I changed it to:
CatType - varchar.

You rock.
Thanks you
Wayne