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

I could help on Formula 1

Status
Not open for further replies.

teamssc

Instructor
Nov 16, 2000
65
0
0
US
I'm using the following record selection formula in Crystal 8.5 to select data from GoldMine dBase. The formula works OK but I just discovered it is excluding any companies that are blank. I need to exclude companies that contain the three company names I have shown.... and not exclude blank companies. I could sure some help. Thanks! Don

{ContHist.ONDATE} = {?Date_Range} and
not ({Contact1.COMPANY} startswith ["Party Time", "PTR", "CS3"]) and
{ContHist.REF} startswith ["1.", "2.", "3.", "4.", "5.", "6.", "7.", "8."]
 
HI,

Consider:
{ContHist.ONDATE} = {?Date_Range} and
((not ({Contact1.COMPANY} startswith ["Party Time", "PTR", "CS3"])) or isnull({Contact1.COMPANY})) and
{ContHist.REF} startswith ["1.", "2.", "3.", "4.", "5.", "6.", "7.", "8."]
 
poujor, tests for null must always come first. Any other test on the field will cause the formula to stop, even if null is processed later.

Reversing the test would probably work. But I'd advise writing it separately as a 'boolian', a formula field saying
Code:
not isnull({Contact1.COMPANY}) 
and {Contact1.COMPANY} startswith ["Party Time", "PTR", "CS3"])
Placed on a display line and removed from selection, it should return True or False. Check it does so correclty, then include in selection. If it was @BadCompany, then selection should say not @BadCompany


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The null test has to occur before the field is referenced again. It should be:

{ContHist.ONDATE} = {?Date_Range} and
(
isnull({Contact1.COMPANY}) or
not ({Contact1.COMPANY} startswith ["Party Time", "PTR", "CS3"])
) and
{ContHist.REF} startswith ["1.", "2.", "3.", "4.", "5.", "6.", "7.", "8."]

-LB
 
All of you guys are great.. thank you. In the end lbass was on the mark with the order of the insnull.

Thanks again!
 
using database: SQL2000 and Crystal Report 11

The existing report is grouped by "COMPANY"
then by "LINE". The body (located in the LINE group footer) displays the group amount by LINE and then the summary is displayed under the Company group footer. Based on the sample data below, the Company summary is a running total that should sum amounts on each change of "ID" however it does not work, it adds all the lines of the amount field instead. Am I missing something.

thanks for your help.

"SAMPLE DATA"
ID LINE COMPANY AMOUNT
20856 19.2 Company1 45
20857 19.2 Company1 456
20857 21.1 Company1 456
20858 19.2 Company1 136
20859 19.2 Company1 214
20859 21.1 Company1 214

*****************************************
LINE Amount
19.2 851
21.1 670
-------
Total by Company1 1521 <--- False Ttl

*****************************************
LINE Amount
19.2 851
21.1 670
-------
Total by Company1 851 <--- Desired Ttl

 
Please repost and start a new thread.

-LB
 
sorry please disregard the last thread of email, my mistake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top