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

records selection based on a parameter

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Hi All,
A report has 3 paratmeters

1. account group
2. Unit
3. Period

My user wants another parameter which will be Account Type

where the input value is enter as eg: ASSET or LIABILITY or ALL


But using the database field I can Identify if it's asset or liablitiy by

doing writing this formula

@AccountType

if RIGHT({table.field},2) = '01' then
'ASSET'
else
if RIGHT({table.field},2) = '02' then
'LIABILITY'


How can I check it in record selection when the new parameter {?AccountType} is added.

if {?AccountType} = 'ALL' then
true
else

How can I check {?AccountType} against the database field.



Any ideas are grealty appericated...

Thanks in Advance,

Sweetie
 
if {?AccountType} = 'ALL' then true else
if {?AccountType} = 'ASSET' then RIGHT({table.field},2) = '01' else
if {?AccountType} = 'LIABILITY' then RIGHT({table.field},2) = '02'





Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Try might try using the switch function, something like:

right({table.field},2) = Switch ({?AccountType} = "Asset", "01",
{?AccountType} = "Liability", "02",
true,right({table.field},2) )

I would do this using a SQL Expression and converting the right({table.field},2) to a new field to assure SQL pass through, and then the formula would be simpler. But since you didn't share Crystal version nor database type...

-k
 
Thank you all for the reponse.


Since I am passing Peoplesoft Query to Crystal version 8. I dont have the SQl Expression option.

Thank you again.
Sweetie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top