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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 instead of isNull...

Author  Topic 

benko
Starting Member

24 Posts

Posted - 2004-11-08 : 11:51:21
quick question...is there a function to check for like isblank just like isNull. Cause the field isnt null it is blank. Thanks in advance.

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-11-08 : 12:01:58
field = ''

rockmoose
Go to Top of Page

benko
Starting Member

24 Posts

Posted - 2004-11-08 : 17:43:14
What about in a select statement, like Select rxFeild = isnull(@field, 'All') but i need to be able to check for blank rather than null. I dont want to do If statement if i dont have to. Just trying to find a more efficient way! Thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-11-08 : 17:45:18
SELECT *
FROM Table1
WHERE rxField = ''

Tara
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-11-08 : 21:12:05
Or are you looking for a CASE statement?

SELECT rxFeild = CASE WHEN rxFeild='' THEN 'All' ELSE rxFeild END
FROM Table1

I don't know if it is more efficient, but you could also do

SELECT rxFeild = IsNull(NullIf(rxFeild, ''), 'All')
FROM Table1

Kristen
Go to Top of Page
   

- Advertisement -