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

Formula question

Status
Not open for further replies.

hereigns

MIS
Sep 17, 2002
172
US
W2K Pro spk 4
CR Pro v10
SQL 2K Database

Need help with displaying specific records (multiple) within the database. The information in question is located in two fields (tblJournal.JournalAction) and (tblJournal.Note).

Need the report to display tblJournal.Note if JournalAction meets specific criteria. For example:

If Journal.JournalAction = W9 then display the information for this Note.
and/or
If Journal.JournalAction = Company Info then display the information for this Note.

Example Interface View:
NOTE: ACTION: WRITTEN BY:
On File Company Info Yvette
33-09 W9 Yvette
06/05/06 Gen Liability Martha

Want the report to display like so:
Company Info W9
On File 33-09

Does this make any sense???
 
Go into the Report->Select Formulas->Record and try:

{tblJournal.JournalAction} in ["W9", "Company Info"]

This will allow Crystal to limit the rows returned by SQL Server to those records.

If you need all records returned, but you're only modifying these conditions, create a formula for use in the details section for the notes field as in:

if {tblJournal.JournalAction} in ["W9", "Company Info"] then
{tblJournal.Note}
else
""

This would show blank unless the condition is met.

-k
 
Thank you for the information.

I noticed when I followed your example (see below) it only displayed the "Note" associated with "Company Info" even though the criteria matched both and the database has two separate entries.

It looks to me like there's something missing that's needed in order to tell the report to grab/display each note and not just one (assuming criteria is met).

if {tblJournal.JournalAction} in ["W9", "Company Info"]
then {tblJournal.Note} else
 
I still don't know what you want, note that I gave 2 different solutions, based on what you *might* want, and rather than explain it, you state that something doesn't work.

You may have something already in your record selection but the example formula, if placed in the details will work. Unless the spelling or case is incorrect.

-k
 
Sorry I'm not making sense, not trying to confuse you. The confusion is probably due to my lack of understanding how Crystal works.

I did place your suggestion in the details section of the report and tripled-checked the spelling of the criteria, looks good.

In hopes of clarifying what I'm asking, the database can store multiple "journal" entries for an account. Each with their own records under the same field. I need to display these multiple records under different "text" on the report.

tblJournal.JournalTopic = "Company Info" and "W9"
tblJournal.Note = "whatever information is typed via interface"

So ultimately I'd like it to display like so...

Page Header B: "Company Info" & "W9"

Details: "text that coincides with company info" & "text that coincides with "W9"

Hope this helps???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top