473,549 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "...require s 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 8305
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 "...require s 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*******@gmai l.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 "...require s 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
3790
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
11292
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: --------------------------- <xsl:for-each select="headdata/extension/person">
34
6412
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 operator. Here's what I'm trying to do. I've defined class Complex as class Complex { friend ostream &operator<<( ostream &, Complex & ); public:...
11
2436
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 the spec (10.1.6) the activation-object already contains the the parameters-object when the variables are instantiated (10.1.3). The question is now:...
145
6186
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 programs: /*** a.c ***/
6
17069
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 answers as early as possible, thanking u all vijay
48
3326
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 "toupper" function imposes a further constrait in that the value passed to it must be representable as a unsigned char. (If C does not require all...
1
2136
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 can't do it anymore can someone tell me what to do please........
0
1275
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 example of what I'm trying to do. (It reads the system tables sysobjects, sysconstraints, and syscolumns, and returns a table of records, empty or...
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7726
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5377
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.