>Does SQL Server have anything like VFP's IIF where I can check if the user leaves the judgecode blank and I would add the following in VFP
>"where IIF(!EMPTY(parameter),judgecode=parameter,!empty(judgecode))"
See CASE function in BOL. You don't have to do things in SQL the same way as you do in VFP. In fact, you shouldn't because T-SQL has its own ways to do things. Can you explain what that convoluted expression/condition suppouse to do?
--sb--