• Not sure if this is the real code or not, but I would recommend using the complete column list instead of select *. What if someone adds a new column how will your report handle an extra column?

    You can use a case statement to handle the option for 0 for non-Keyboard devices, like so:Select Columnlist

    ,case when DeviceName = 'Keyboard' then DeviceName else '0' end as DeviceName

    from Production

    where Owner = 'Mark'



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]