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

Formula Returning Zero Value

Status
Not open for further replies.

faush

MIS
Mar 6, 2001
38
US
I have a simple formula:

if {FILE.SECTNAME} = "SECT" then {FILE.SECTAMT}

SECT = a section that our members pay to join. SECTAMT = the amount a member must pay.

I need to display that amount on my report.

When I browse the field data, the amount is displayed, but so is a 0.00 value above it, and that is what it is choosing to display. I need for the actual section amount ($20.00) to be displayed.

I have about 15 sections that I have to do this for, so the select expert will only work on the first section.

Any ideas? There are other amounts in the SECTAMT field, and it doesn't return those, just the correct amount and 0.00 for some reason.

Thank you.
 
perhaps there is a Null value in the data...

modify your formula to

if not isnull({FILE.SECTNAME}) then
if {FILE.SECTNAME} = "SECT" then {FILE.SECTAMT};


you might consider "else" sections to the "IF"'s as well

jim
 
I tried that, but I still don't get the data displayed, I just get 0.00 value again.

I also enabled "Report Options" convert NULL to default.

Any other suggestions would be helpful. thanks.
 
to see what is going on...remove the formula field from the report and just add {FILE.SECTNAME} and {FILE.SECTAMT}back

then you can see what is going on with the data
 
That just returns the first section name in the file and an amount that's not related to it, since there are other amounts in the file SECTAMT that relate to other amounts members need to pay.

SECTNAME has about 25 different section descriptions, and SECAMT has 8 different amounts in it, so if I insert just those fields on the report, it pulls the first value of each, which don't match.
 
I understand but when {FILE.SECTNAME} = "SECT" do you get the expected result for {FILE.SECTAMT}....if not then there is something wrong about the way you have grouped and/or linked the data and tables.

Is "SECT" a real value or just a label to indicate that the comparison value would be plugged in there?

if you can, run the report in this way against a known result and compare.
 
Browsing shows a sample of values from the table, taken from the first 500 records. It may have little to do with the data used in the report.

What do you mean by 15 sections? The select expert applies to the entire report. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
THANK YOU...I was focusing on the wrong part of the report -I reviewed my tables and fixed the linking, everything is being displayed as it should!

Thanks so much! You guys are great, especially for beginners like me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top