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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!!! ANYONE KNOWS HOW TO INSERT 0 TO A BLANK FIELD? 1

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
Hi,

please HELP!!!!!!!!!! does any of you know how i can add 0 into a Blank field?

thank u
 
Can you be a little more specific. Also, what version of crystal do you have.
 
in the formular fields choose new enter a name then choose use editor. enter the if statement for whatever field you need to replace with 0 when null. I am using CR9 but the idea is the same use if statement

if isnull({table.id}) then 0
 
use the else part if it is not null then the value unchange

if isnull({table.id}) then 0 else ({table.id})
 
then go back to design view and click on the + of formula field and click and drag the new formula you just created to where ever you want good luck. I just had this CR 9.0 for two days getting a hang of it now.
 
hi, i'm using CR 8.5

thanks for your reply, tdong

i use the isnull to check if it is a null field. in crystal dictionary, it said null doesn't equal to zero or blank. if isnull apply and it said true, it means the field is a null otherwise it's not.

for my case, my field is not a null field. it is a blank field.

please please HELP if anyone knows it.. thank u thank u thank u

m
 
Or, you could try:

if trim({table.field}) = "" then 0 else {table.field}

-LB
 
In case you haven't been forewarned, Crystal has dropped the SQL Designer from it's product line in CR 10, so anything you design using it will have to be redesigned (not just repointed) when you upgrade, so try to avoid using it.

As for your formula, I tend to be thorough just in case:

if isnull({table.field}
or
trim({table.field}) = "" then
0
else
{table.field}

-k
 
thorough, but not always accurate (forgot the paren):

if isnull({table.field})
or
trim({table.field}) = "" then
0
else
{table.field}

-k
 
synapsevampire solution would work very well in your case. Your question wasn't clear at start I thought your database allow null then isnull alone would do the trick. hehhehe
 
hi everyone,

i've tried it, but it doesn't work. is it because i use subreport, that's why it doesn't work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top