Can I perform a select statement that will return the value in one of two columns based on the value in one of the columns?
Here's my situation: I have an Employee table with the columns FirstName, LastName and OtherName. The OtherName column is for nicknames or what the person goes by - example: FirstName = Robert, OtherName = Bob
What I want to do is provide a view for an application and the view should show the person's preferrd name: "Bob Jones" instead of proper name: "Robert Jones". I am performing a query and concatonating the two fields, if the OtherName column is 'NULL' then I want the query to pull the FirstName.
I know this is easy to do through the application the problem is it is actually several applications that currently point to an Access DB but the company has grown and so we have a new HR database on SQL and this has become an issue and so I want to create a view that mimics the Access table.
Thanks for any help you can offer......
Here's my situation: I have an Employee table with the columns FirstName, LastName and OtherName. The OtherName column is for nicknames or what the person goes by - example: FirstName = Robert, OtherName = Bob
What I want to do is provide a view for an application and the view should show the person's preferrd name: "Bob Jones" instead of proper name: "Robert Jones". I am performing a query and concatonating the two fields, if the OtherName column is 'NULL' then I want the query to pull the FirstName.
I know this is easy to do through the application the problem is it is actually several applications that currently point to an Access DB but the company has grown and so we have a new HR database on SQL and this has become an issue and so I want to create a view that mimics the Access table.
Thanks for any help you can offer......