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

URGENT HELP!! HOW TO replace a NULL value and show a specific column?

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
hi,

how to replace all the data to a null value? and how to write in formula that i only wanna c a record set for a specific column that doesn't have a null value and i wanna replace couple of the columns to a null value..

example

data before changes made:
work cen qty sap
su 30 0
su 30 15
su 20 0
hk 30 40
hk 30 0

after the changes:
work cen qty sap
su 0 15
hk 30 40
hk 30 0

so, i only wanna to c work cen of SU that where sap != '0' and replace value from qty = '0'

would be sth like :

if workcen = 'SU' then
sap !='0' ??

please be advice... really really really need.. would appreciate very very very much..t ahnk u..

m
 
Nothing you have shown above is a null value.....zero is not the same as null. What do you want to show when there is a zero value?

Also please use English, not "wanna", "c", "u", etc. etc.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
hi,

i'm sorry for the english part and confusing part

my question here is:

i want to replace a number to 0. in formular editior, i have my code written as

if (workcen = 'su' and SAP <> 0) then
qty = 0 and
issued = 0
else
workcen

from the above, i want to show every &quot;SAP&quot; that is not equal to 0 whenever workcen = 'su'. if this is valid, then, replace everything in qty and issued column to be 0. otherwise, return all workcen.

example

data before changes made:
work cen qty issued sap
su 0 3 0
su 30 4 15
su 20 5 0
hk 30 0 40
hk 30 2 0

after the changes:
work cen qty issued sap
su 30 0 0
su 20 5 0
hk 30 0 40
hk 30 2 0


i've been posting for a while, but i didn't get respond .. i really really need your help.. please help and be advice.. many many million thanks..

m
 
Is the formula real Crystal formula? It doesn't have {} around the field names, amongst other problems.

Anyway, I'd guess that you want something like:

whileprintingrecords;
numbervar qty;
numbervar SAP;
if (workcen = 'su' and SAP <> 0) then
qty := 0
else
qty := {table.qty};
qty

And another formula for:

whileprintingrecords;
numbervar SAP;
if (workcen = 'su' and SAP <> 0) then
sap := 0
else
sap := {table.qty};
qty

Hard to say though because you omitted:

su 0 3 0

When your logic states that if it's not one condition, than always show the workcen info.

If you truly don't want to show any of the rows that have 0 qty and 0 SAP, use Report->Edit selection formula->Record:

(
{table.workcen} = &quot;SU&quot;
and
{table.qty} = 0
and
{table.sap} = 0
)

-k
 
hi k,


thanks for your response to my question, however, i still don't found the formula works.

i want to zero out the columns whenever work_center = 'su' and coln_sap <> 0. also, i want to show the 'su' work center which the scap doesn't contain 0. otherwise, show all work_center..

i hope i didn't confuse you..

it will be great if you can advise me on that..

many many many thanks..

m
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top