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

Use a database field in a report formula

Status
Not open for further replies.

Dancan

Programmer
Dec 10, 2001
2
0
0
US
I'm developing a formula that extracts a serial number from 23 fields. When the parameter input is matched, I want to output the corresponding part number description from one of another 23 fields (bad database design:). I have this idea of using a conditional formula using the field names to control the output of the part number description field name. Is there a way to use a database field name in a formula?
 
You can create a formula like:

Select @condition_Formula
Case "Column1" :
{mydb.column1}
Case "Column2":
{mydb.column2}
...
Default :
{mydb.some_default_column};

Cheers,
- Ido
ixm7@psu.edu
 
Or the old if-then:

if {field} = 1 then {Field1} else
if {field} = 2 then {Field2} else
if {field} = 3 then {Field3} else {Field23}
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top