Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NULL value

Status
Not open for further replies.

poupou

Programmer
Jun 12, 2002
6
CA
How can I change Null value by Zero ?


Thanks a lot

Redg
 
Something like:

IF ISNULL('MyField')
REPLACE MyField WITH 0
ENDIF
-or-
REPLACE ALL MyField WITH 0 FOR ISNULL('MyField')
Dave S.
 
Here's what MSDN Library (on-line Help) has to say:

Null Value Handling

Visual FoxPro provides support for null values. This support simplifies the task of representing unknown data and makes it easier to work with Microsoft Access or SQL databases that may contain null values.

Null values are:

Equal to the absence of any value.
Different than zero, the empty string (""), or blank.
Sorted ahead of other data.
Propagated in calculations and most functions.
Null values affect the behavior of commands and functions, logical expressions, and parameters.

Visual FoxPro support for null values complies with ANSI standards and affects any area of the product where values and expressions are used.


Using NULL in Values and Expressions
In Visual FoxPro, you assign the null value programmatically with the .NULL. token or interactively with CTRL+0 in a field. Note that the periods around .NULL. are optional. To detect whether a field or variable contains a null value, or whether an expression evaluates to a null value, use ISNULL( ).

See Also
Behavior of Null Values in Logical Expressions | Behavior of Null Values in Commands and Functions | EMPTY( ) Function | ISBLANK( ) Function | ISNULL( ) Function | NULL as a Parameter | NULL as a Value | Data Manipulation

Hope this will help. You might want to find it yourself in your own MSDN Librar (should be provided on CDs when you buy MS VS 6.0 or VFP 7.0) and follow the thread there.

Regards,

Ilya
 
or you could say

SET NULLDISPLAY TO "0"

just a suggestion...

torturedmind [trooper]
 
Hi POUPOU

In the place of the field or variable.. use the NVL function to display the value..
For example..

? NVL(nField,0)
This will display nField .. if it is not null or 0

? NVL(cField,SPACE(1))
This will display cField .. if it is not null or SPACE(1)

In the place of nField or cField, you can use your variable names also. :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top