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

Formula to print one of 3 fields

Status
Not open for further replies.

Hoppkins

Technical User
Sep 8, 2003
14
GB
I have 3 fields called "Author", "Corp Author" and "Conference".

I'm trying to make a formula where if Author is populated it will print that.

If it's not it will check Corp Author and if thats populated print that, if thats blank then print conference.

I'm using the formula from a working example of another report of:

if OnFirstRecord and isnull ({tAuthor.fSystemKey}) or {tAuthor.fSystemKey}="" then {%Corporate} else
if OnFirstRecord and isnull ({tCorpAuthor.fSystemKey}) or {tCorpAuthor.fSystemKey}="" then {%Conference} else
if OnFirstRecord and isnull ({tConference.fSystemKey}) or {tConference.fSystemKey}="" then {%Author}

Where the %Author etc are "{fn LEFT(tAuthor."fTerm",200)}"

When i try and print this i get nothing printing at all.

Any ideas? Also can anyone explain the "Onfirstrecord" command? I read that it evaluates the statement as true if it's the first record in the report? Im not sure what that means.

Thankyou
 
I'm not sure how to expound on the definition you have already supplied, as you have hit the nail squarely on the head.

By the first record, you are essentially saying the first row. Let's assume that your query returns 500 rows. Your formula is only going to try to evaluate for row number 1, being as you have applied the OnFirstRecord function to every clause.

Take this function out altogether, and your formula will work fine.

Naith
 
Thanks, ive tracked down the problem. One of the fields is behaving oddly, before i try and make the formula work i will need to debug this field.

Thanks for the reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top