Hi, I have a list to populate. I have a query to populate it in mssql 2008. It involves three tables. If the query returns the value then I populate it and it is done. But , if the query doesnot return anything then I want to run another select statement because I do not want to leave the list view empty. I have to populate at least the names of the client. It could be something simple but I am just beginning to use mssql so I am stuck. Select C.name as Client , B.Detail as Detail from tableA A left join tableB B on B.bID = A.bID Left join tableC C on C.clientID = B.clientID where aID= '100'; if does not return anything, I want to run another sql to atleast get the name of the client even if there is no related detail with that client. second sql would be Select C.name as Client from tableA A Left join tableC C on C.clientID = A.bID where aID= '100' [P.S. the bID field of Table A could actually either be bID as is or C.clientID inserted into bID field of Table C.] I am confident about the queries but its just about extracting the values from the result. Thanks,
B
begg
@begg