I'm using SQL7The code below works fine but the score column shows a number representing the persons position. It only ever shows four rows i.e. a score of 4 is actually 1st place, 3 is 2nd place, 2 is 3rd place and 1 is fourth place.So a typical resultset would be:Joe Bloggs ABN 4Ivor Bigun Deutsche 3John Doe UBS 2Paul Knookie IIRG 1
ok, hopefully that's clear !? What i want to do is show '1st' instead of the 4, '2nd' instead of the 3, '3rd' instead of the 2 and obviously '4th' instead of the 1.Is there a way of doing this within the SQL Statement below or do i have to do this within the front-end coding that EXECs the SP.In MSAccess i know i could've used the IIF function for this, is there a MSSQL equivalent ?any help appreciatedthanks CREATE PROC usp_PlcVotedBemco_sel@PlcCode int,@UID varchar(7)ASSELECT Broker_Employee.fs_forename, Broker_Employee.fs_surname, Brokers_in_UID.fs_brokernameinUID, Plc_Bemco_Ranking.fd_scoreFROM Broker_Employees_in_UID INNER JOIN Broker_Employee ON Broker_Employees_in_UID.f_brokerEmployeeCode = Broker_Employee.fa_brokerEmployeeCodeINNER JOIN Plc_Qaire ON Broker_Employees_in_UID.fs_UID = Plc_Qaire.fs_UID INNER JOIN Plc_Bemco_Ranking ON Plc_Qaire.fa_qID = Plc_Bemco_Ranking.fi_plcQaireID AND Broker_Employee.fa_brokerEmployeeCode = Plc_Bemco_Ranking.fi_bemcoCodeINNER JOIN Brokers_in_UID ON Broker_Employees_in_UID.fs_UID = Brokers_in_UID.fs_UID AND Broker_Employees_in_UID.fl_brokerCode = Brokers_in_UID.fl_brokerCodeWHERE Plc_Qaire.fi_plcCode = @PlcCodeAND Plc_Qaire.fs_UID = @UIDORDER BY Plc_Bemco_Ranking.fd_score DESC
====Paul