![]() |
select query
Hi,
I have a table with 2 fields: passport varchar idNo numeric I have to display the fields in one column If idNo is null then I want to show the passport number in the column but if neither passport or idNo are null then I want to show the idNo. I tried the following select query but it only works if both fields are numeric and i can't change the data type for one of the fields as it will coz huge problems: select idno,passport, (case when idno is null then passport else idno end) as sid from student How can I make it work? Thanks |
you may want to create a UDF for this
but here is my try: Code:
|
Thanks i will try it
|
All times are GMT -4. The time now is 09:08 AM. |
Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.