By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,466 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

How to figure this one out - "The isnull function requires 2 argument(s)"

P: n/a
Hello All,

In SS EE I have nulls in a column. I want to select and eventually change to a zero (its a smallint column). I've tried selecting 'null', 'dbnull',
etc. Then I read about the ISNULL function. From the example I got, I received the "...requires 2 arguments...." error. Read up on it but it
doesn't click with me.

Could someone explain the error? And secondly, how to select null fields?

Thanks,

Hexman

====================== Code Below ================
use CNDB
select * from cnmaster
where isnull(cnpick)

Msg 174, Level 15, State 1, Line 3
The isnull function requires 2 argument(s)
Sep 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Hexman,

SELECT * FROM Table WHERE Field IS NULL

The change to zero SQL looks like:
UPDATE Table SET Field = 0 WHERE Field IS NULL

The ISNULL function converts a null value into a non-null value.. so..
SELECT Field AS NullField, ISNULL(Field, 0) AS NotNullField FROM Table
....would return ALL records, but report any null values in Field as zero,
without changing the underlying data.

ISNULL() is a reporting function.. not a data changing function.

-Boo
Hello All,

In SS EE I have nulls in a column. I want to select and eventually
change to a zero (its a smallint column). I've tried selecting
'null', 'dbnull',

etc. Then I read about the ISNULL function. From the example I got,
I received the "...requires 2 arguments...." error. Read up on it but
it

doesn't click with me.

Could someone explain the error? And secondly, how to select null
fields?

Thanks,

Hexman

====================== Code Below ================
use CNDB
select * from cnmaster
where isnull(cnpick)
Msg 174, Level 15, State 1, Line 3
The isnull function requires 2 argument(s)


Sep 29 '06 #2

P: n/a
Works beautifully! Thanks a bunch.

Hexman
On Fri, 29 Sep 2006 04:35:55 +0000 (UTC), GhostInAK <gh*******@gmail.comwrote:
>Hello Hexman,

SELECT * FROM Table WHERE Field IS NULL

The change to zero SQL looks like:
UPDATE Table SET Field = 0 WHERE Field IS NULL

The ISNULL function converts a null value into a non-null value.. so..
SELECT Field AS NullField, ISNULL(Field, 0) AS NotNullField FROM Table
...would return ALL records, but report any null values in Field as zero,
without changing the underlying data.

ISNULL() is a reporting function.. not a data changing function.

-Boo
>Hello All,

In SS EE I have nulls in a column. I want to select and eventually
change to a zero (its a smallint column). I've tried selecting
'null', 'dbnull',

etc. Then I read about the ISNULL function. From the example I got,
I received the "...requires 2 arguments...." error. Read up on it but
it

doesn't click with me.

Could someone explain the error? And secondly, how to select null
fields?

Thanks,

Hexman

====================== Code Below ================
use CNDB
select * from cnmaster
where isnull(cnpick)
Msg 174, Level 15, State 1, Line 3
The isnull function requires 2 argument(s)

Sep 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.