Solved

The text, ntext, and image data types are invalid in this subquery or aggregate expression.

Posted on 2004-08-02
6
526 Views
Last Modified: 2006-11-17
SELECT MIN(Memo) FROM PmtsMemos WHERE PmtsMemos.InfinityRecNo = 0

in this example the memo field is ntext.

What can i do?

0
Comment
Question by:tricks801
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 11

Expert Comment

by:SweatCoder
ID: 11696264
what's the problem? an error?
0
 

Author Comment

by:tricks801
ID: 11696302
ok, the Min was a mistake...but this is found as a subquery, so it is still coming up with the same error
0
 

Author Comment

by:tricks801
ID: 11696307
sorry....the error is stated in the title:  The text, ntext, and image data types are invalid in this subquery or aggregate expression.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:tricks801
ID: 11696321
a very simplified version of the actual query...
select (SELECT (Memo) FROM PmtsMemos WHERE PmtsMemos.InfinityRecNo = 620073)
0
 
LVL 1

Accepted Solution

by:
seangw earned 500 total points
ID: 11696363
You can't select a min or max of a binary type (aggregate functions on ntext, etc.)  if you want to do so, you can try to convert the type to an integer then do the min on it.

This should raise the question on whether you are using the correct datatype here.  If you are always going to have numbers, you are best off correctly classifying the field as int, or float, to speed up the database as well as open up these useful aggregate functions.
0
 

Author Comment

by:tricks801
ID: 11696421
the agg function was a mistake... i fixed it by cast(memo as nvarchar)

thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question