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!

Record selection formula

Status
Not open for further replies.

crystalize

Vendor
Nov 20, 2007
26
US
I am trying to print certain records based on the value of one line. For example if userfield.fieldposition=1200 and
userfield.numberfield= 1 then print certain lines.


{USERFIELD.FIELDPOSITION} in [1000.00, 1100.00, 1200.00, 1600.00, 1800.00, 1850.00, 100.00, 2000.00, 2100.00, 2200.00, 2400.00, 2500.00, 2525.00, 2550.00, 2575.00, 2600.00, 2700.00, 2800.00, 2900.00, 22.00, 23.00, 3000.00, 3100.00, 3200.00, 3300.00, 3400.00, 3425.00, 3450.00, 3475.00, 600.00, 700.00, 75.00, 800.00, 900.00]and
if {USERFIELD.FIELDPOSITION} = 1200.00 and
{USERFIELD.NUMBERFIELD} = 1.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 4200.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 2.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 4500.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 3.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 4800.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 4.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 5100.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 5.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 5400.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 6.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 5700.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 7.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 6000.00] else
if {USERFIELD.FIELDPOSITION} = 3900.00 and
{USERFIELD.NUMBERFIELD} = 8.0 then
{USERFIELD.FIELDPOSITION} in [3500.00 to 6300.00]

Currently it only prints the data on line 1200 and all the other data in the first field positon range, but it doesn't print like I want it to.


I am using Crystal Reports 9 and Oracle 8i.
 
You are saying that if the field = a certain value, then choose different values of that same field. If you look at your data in the detail section, sorted by fieldposition, you will see that this does not make sense. It looks to me like you need to add the table a second time and then set up your formula like this:

if {USERFIELD.FIELDPOSITION} = 1200 and
{USERFIELD.NUMBERFIELD} = 1 then
{USERFIELD[red]_1[/red].FIELDPOSITION} in [3500.00 to 4200.00] else //etc.

Your first line makes no sense to me in relation to the rest of the formula--it looks like you mean for it to be a record selection formula.

-LB
 
if {USERFIELD.FIELDPOSITION} = 1200 and
{USERFIELD.NUMBERFIELD} = 1 then

Userfield.fieldposition is the 1200th line (record selection),
and userfield.numberfield is the value in that fieldposition.
I need to go to that 1200 line and evaluate the value there and print other records based on that value. I think I didn't explain that very clearly the first time.


I tried what you suggested but it didn't return any values.
 
How did you link the tables? Please show the fields available in the userfield table with a little description of what they are if it is not obvious.

-LB
 
Here are the available field details for userfield file. It stores user field values and other information for user defined fields.

I linked (inner join) USERFIELD.ROW_ID to matter.matternumber_id. And I linked (inner join)matterlitigation.matternumber_id to matter.matternumber_id.

See attachment for available fields in this file.

 
Your links don't work. Please answer in the thread.

-LB
 
module id
tablename
row_id
userfieldprofile_id
tab_id
type_cd
parent -not used
description
required
datatype
fieldposition
usereditmask
lookupcategory
userfieldvalue
numberfield
stringfield
bytefield
datefield
logicalfield
comment_id
constraintvalue
changeby
lastchange
type_cat

Let me know if you need a brief description of any of these. Thanks.
 
I can't really tell what you should link on. Sorry. But this is the approach I think you need to take.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top