cancel
Showing results for 
Search instead for 
Did you mean: 

Record selection formula in sql command in Crystal report

Former Member
0 Kudos

Dear all,

I have some filter query  to pass as record selection formula in crystal report. I am having some problems with below sql command .

in some of filter im getting errors.

Kindly help me ..

1. ({AddDedTypeRights.AdddedType} Like 'SYS[_]%%' Or  {AddDedTypeRights.AdddedType} Like 'SYSL[_]%%' )

this is a part of record selection formula filter..  Is this ok? (correct in syntax?)

2. {AdddedTran.EmpID} Not In [Select {FinMast.EmpID} From FinMast With (NOLOCK) Where {FinMast.Status} = 35]

Its wrong..  tell me the proper way..

3. ({LeaveTran.SalaryStatus} & 😎 = 😎

how to make this correct.....?

kindly reply me please

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Denson,

1) This should be:

({AddDedTypeRights.AdddedType} Like ['SYS[_]*', 'SYSL[_]*' )

2) You cannot pass a 'select' clause inside a record selection formula

3) Not sure what you're trying to do here

-Abhilash

Former Member
0 Kudos

I mean & operator is not working in  crystal report record selection formula.

i want to used '&' like this

({LeaveTran.SalaryStatus} & 😎 = 8  And {Employee.EmployeeStatus} = 1

can tell tell me whtss wrong with it?

DellSC
Active Contributor
0 Kudos

Try using "+" instead of "&".

Also, are you writing a Command or are you linking tables?  If you're using a Command, you need to put the selection criteria in the Command, NOT in the Select Expert!  See this blog for information about best practices when using commands: 

-Dell


Former Member
0 Kudos

Can we do like this also in record selection formula..

((Month(DateAdd(dd,{LeaveTran.TotalDays},{Leaving.ActStartDt})) = " + m_RepDate.Month + ")

abhilash_kumar
Active Contributor
0 Kudos

You should avoid any kind of date transformations in the record selection as they're usually not translated to the where clause.

The formula would still be:

Month(DateAdd(dd,{LeaveTran.TotalDays},{Leaving.ActStartDt})) =  {m_RepDate.Month}


-Abhilash

Answers (0)