5 replies
by pina
Poster rated this answer.
by sgt_shultz
by it_cowboy
In a query that will provide the data for the report, create a new field. The new field will contain a formula that will check the first field for content, then if there is information in it will return the value from the second field, otherwise it will be blank.
To create a field in a query, enter a name (without spaces is easiest) followed by a colon. For this example, the new field will be called "Result". Replace "First Field" with the field name containing the data you want to check for. Replace "Second Field" with the name of the field that you want to show if first field contains data.
Result: Iif(Len(Trim(Nz("First Field","")))=0,Null,"Second Field")
The function checks the length of the first field (after returning a zero length string if the value is null (Nz function) and has had all leading and trailing blanks removed (Trim function). If the length is zero, the Results field will contain nothing. If first field contains informaiton, then the value in the second field will displayed in the Results field.
by pina
Poster rated this answer.
This discussion is closed to new replies.
Trending Software posts
Sort by Trending