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

Problem with Formula 1

Status
Not open for further replies.

CrystalUser1

Programmer
Sep 16, 2004
138
US
Hi,

Can somebody explain what is the following record selection formula doing? This was written by somebody, I need to understand and change the logic.

I am using crysal reports 8.5.


Record Selection Formula:


(trim({%LastNameFirstMName}) = "," and trim({?EmployeeName}) <= " "
or Replace({%LastNameFirstMName}," ","") startswith replace({?Employee}," ",""))


%LasNameFirstMName is the following sql Expression:

{fn CONCAT({fn CONCAT({fn CONCAT({fn RTRIM(Employee."Employee_LNAME")},' ,' )},
{fn LTRIM({fn CONCAT({fn RTRIM(Employee."Employee_FNAME")},' ' )})})},Employee."Employee_MNAME" )}


?EmpployeeName is the parameter in the above record selection formula.

Please help me in understanding the above record selection formuala.

thanks in advance.
 
It returns rows where the sql expression is just a comma and the parameter was empty, or it returns the sql expression where it starts with what was entered in the parameter.

-k
 
thank you K for your help, can you explain little bit on this what is doing actually?

or Replace({%LastNameFirstMName}," ","") startswith replace({?Employee}," ",""))

thanks

 
This:

Replace({%LastNameFirstMName}," ","")

Replaces spaces with nothing

This:

startswith replace({?Employee}," ",""))

says if it begins in what's in the employee prompt, after it has replaced any spaces with nothing.

So it states that if what was entered in the parameter, after it's replaced the blanks with nothing, is at the beginning of what's in the %LastNameFirstMName SQL Expression then return it.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top