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!

If statment to replace 1 field string with with 3 different strings

Status
Not open for further replies.

Wilnicm

MIS
Mar 16, 2009
20
US
How do i do this if statements if i want replace a field's string with a different field string Example

If {Command_1.AL_DESCRIPTION} = "Financials (FI) " Then
"FI", "Letters DAY 1", "Letters DAY 2"

This would replace Financials (FI) field with three separate strings which are"FI", "Letters DAY 1", "Letters DAY 2" .

I keep getting an error. Don't know how to show this in a formula

Any help would be greatly appreciated..

<Will The Great>
 
If the 3 strings are literal and not a reference to another field(s)

If {Command_1.AL_DESCRIPTION} = "Financials (FI) " Then
"FI Letters DAY 1 Letters DAY 2"

If those 3 strings are actuall different fields then...

If {Command_1.AL_DESCRIPTION} = "Financials (FI) " Then {table.field1} & {table.field2} & {table.field3}

-- Jason
"It's Just Ones and Zeros
 
Jason,
I i want the ---> {Command_1.AL_DESCRIPTION} = "Financials (FI) " to equal to three separate different separate strings that are actualy strings that are located in the {Command.AL_DESCRIPTION} table and field. All of these strings are coming from the same field which is the AL_DESCRIPTION field..

<Will The Great>
 
Are these strings constant? Always "FI", "Letters DAY 1", "Letters DAY 2"?

Or do you need to parse the AL_DESCRIPTION field for some dynamic values?

-- Jason
"It's Just Ones and Zeros
 
Yes..
These strings will always be constant...

<Will The Great>
 
OK...then if that is the case AND you need to also display the "s and the ,s

Then....

IF {Command_1.AL_DESCRIPTION} = "Financials (FI)"
THEN
('"FI", "Letters DAY 1", "Letters DAY 2"')

-- Jason
"It's Just Ones and Zeros
 
Jason, thanks.. one last question.. current..my report looks like this..in the group format
Financials (FI)<-- this field is in the <--{Command_1.AL_Description}
-"FK", "Letters DAY 1", "letter DAY 2" <--these 3 fields are in this table.field {Command.AL_Description} but there are appearing like this after my code changes there appearing all on one line. I want them to look like this
Financials (FI)
-FI
-Letter Day 1
-Letter Day 2

This is just showing them that they are three different groups under the Financials (FI)group heading.. any help would be greatly appreciated.. thanks..

<Will The Great>
 
If you just need a carriage return between them the use this.

IF {Command_1.AL_DESCRIPTION} = "Financials (FI)"
THEN "FI" & chr(13) & "Letters DAY 1" & chr(13) & "Letters DAY 2"

-- Jason
"It's Just Ones and Zeros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top