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'