Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-08-02
6
Medium Priority
?
531 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

963 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