Hi, I have made user defined function which takes two parameters; the first one is int and and second one is char(1). I am using this UDF three times with different parameters in my query. It works fine on my development machine but when i do the same query on live server it will overwrite last two calls with first call resultset. Below is the sample query for what i am trying to do:- Select count(dbo.fn_GetContractCount(ContractID,'T'))[Total], count(dbo.fn_GetContractCount(ContractID,'N'))[New], count(dbo.fn_GetContractCount(ContractID,'U'))[USED] from tbl_Contract Where SaleDate between '01/01/2007' and '01/01/2008' Results on my machine: Total New Used 12 9 3 Results on live server: Total New Used 12 12 12 Kindly reply ASAP. i will very thankful.