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

simple formula

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need a simple formula which uses a "where" clause. Similar to this SQL statement: Select a WHERE b = c What is this formula in crystal syntax???? Something along the lines of : select {employee.lastName} where {employee.employeeIdNumber} = {project.employeeIdNumber}.
 
a simple If statement will do that

if {employee.employeeIdNumber} = {project.employeeIdNumber} then
{employee.lastName} ;

Jim Broadbent
 
thats about right...however I need it to look like:
**********************
select {employee.lastName} where {employee.employeeIdNumber} = {project.employeeIdNumber};
**********************
furthermore, {project.employeeIdNumber} is the Group Name

how do I do this?



 
Crystal doesn't allow you to use subqueries.

You accomplish joins using the visual linking expert in Crystal.

If you already have the tables joined in some other fashion, and want to compare these two values, just do as ngolem suggested and create a formula:

if {employee.employeeIdNumber} = {project.employeeIdNumber}then {employee.lastName}

-k kai@informeddatadecisions.com
 
Sorry...but this

****************************
select {employee.lastName} where {employee.employeeIdNumber} = {project.employeeIdNumber};
**********************

As you know is a query or subquery as SV has said. Crystal cannot use this as a "formula".

Rather than have us guess...please describe your real problem...between myself, synapsevampire and all the others here we should be able to sort it out Jim Broadbent
 
I'm trying to do something very similar. A simpe "Search and Replace". Where the Status = 200 I want Use the Record Selection Formula Editor replace 200 = PASSED. Here's the SQL to start wtih....
**********************************************
{TPV_PUB_ED_PROD_COMPLETED.STATUS} = 200.00
***********************************************

 
You wouldn't replace this value in the Record Selection Criteria.

You have to create a formula to to do the replacement for you, and display that in the report instead.

//Start
If {TPV_PUB_ED_PROD_COMPLETED.STATUS} = 200.00
Then "Passed"
Else
{TPV_PUB_ED_PROD_COMPLETED.STATUS}
//End

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top