
April 30th, 2004, 03:03 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 11
Time spent in forums: 2 h 6 m 33 sec
Reputation Power: 0
|
|
|
ERROR: The text, ntext, or image data type cannot be selected as DISTINCT.
I have the following code that returns duplicates:
PHP Code:
$qry2 = "SELECT Publications.pub_id, Publications.pub_authornames, Publications.pub_title, Publications.pub_pubdate, Publications.pub_volume, Publications.pub_pubdate, Publications.pub_spage, Publications.pub_epage, PublicationAuthors.puba_id, Biographical.bio_facid, Biographical.bio_firstname, Publications.pub_pubname, Publications.pub_abstract FROM ( Publications INNER JOIN PublicationAuthors ON Publications.pub_id = PublicationAuthors.puba_id) INNER JOIN Biographical ON PublicationAuthors.puba_facid = Biographical.bio_facid WHERE ((( Biographical.bio_facid)= '$id' )) AND (( Publications.pub_pubdate)>='1/1/2000') "; $result2 = odbc_exec($odbc,$qry2); while ($row2 = odbc_fetch_array($result2)){ echo "<blockquote>".$row2['pub_authornames'].";<u>".$row2['pub_title']."</u>;".$row2['pub_pubname'].";".date("Y",strtotime(eqstr2date($row2['pub_pubdate']))).";".$row2['pub_volume'].";".$row2['pub_spage']."-".$row2['pub_epage']."</blockquote>";
}
When I add Distinct in front of the select statement I get the following error:
Warning: odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, or image data type cannot be selected as DISTINCT., SQL state 37000 in SQLExecDirect in..
I just want to eliminate duplicates. ANY ideas?
thank you.
|