You are here: Help - Finding the newest date without using max() « MsSQL Server « IT news, forums, messages
Help - Finding the newest date without using max()

Posted by rgould on 10/04/70 11:58

Hi,

Can anyone help please?

select notefield, modifiedon
FROM Table1
WHERE id = '100426' and
(statusfield like '%criteria1%' OR
statusfield like '%criteria2%')

Produces a list of records based upon the criteria. I would like to be
able to only show the newest dated record, from the modifiedon field.

I've tried max(modified) on, but as I am using an aggregate function in
the query I have to use GROUP BY, which notefield does not like as this
is a ntext field.

(I get:

Server: Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted,
except when using IS NULL or LIKE operator.
)

Any ideas please?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация