473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
2 8294
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: xxx | last post by:
Hello, I get an error message: Global symbol "%Config" requires explicit package name at /usr/lib/perl5/5.8.3/i386-linux-thread-multi/Errno.pm line 11. What does this mean?
3
by: Peter Rohleder | last post by:
Hi, I'm using a style-sheet where I make use of the XPATH-"following-sibling"-expression. The part which makes problems looks similar to the following code: --------------------------- ...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
145
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two...
6
by: murgan | last post by:
Hi people, i am new to this group,this is my first query, friends i want to know the difference between "function pointer" and "pointer to a function" in c lang, so friends please send the...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
1
by: jjelswick | last post by:
my daughter was sending pics of my grandaughters, i right clicked on them and saved them as a screensaver to look at daily(1st twin grandchildren) now i keep getting invalid argument error and...
0
by: downwitch | last post by:
I'm not sure if this is possible, and it's tough to search for via google, so... I have a user-defined function that checks whether a given column has a default value set on it or not, as an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.