Solved

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

Posted on 2004-08-02
6
525 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
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!

 

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

Technology Partners: 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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

679 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