Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CONVERSION PROBLEM

Author  Topic 

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2011-04-13 : 08:51:07
hello everybody,
i got stuck with the query.I have a requirement where if the authorisation_no=0 i need to show empty space.But it still shows 0 with this query
SELECT CASE WHEN AUTHORIZATION_NO=0 THEN ''
ELSE AUTHORIZATION_NO END AS AUTHOR_NO FROM CASHIER

Thanx in advance

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-04-13 : 08:53:12
Try:
SELECT CASE WHEN AUTHORIZATION_NO=0 THEN ''
ELSE convert(varchar(10),AUTHORIZATION_NO) END AS AUTHOR_NO FROM CASHIER




No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2011-04-13 : 09:12:13
quote:
Originally posted by webfred

Try:
SELECT CASE WHEN AUTHORIZATION_NO=0 THEN ''
ELSE convert(varchar(10),AUTHORIZATION_NO) END AS AUTHOR_NO FROM CASHIER




No, you're never too old to Yak'n'Roll if you're too young to die.




Thanks a lot webred..that worked as expected
Go to Top of Page
   

- Advertisement -