anonymouscdn
Technical User
Running Crystal Reports 8.5 / Oracle DB
Having an problem with and OR Statement. It will only display what is before the OR but will not show anything after the OR. Here is the formula:
{EC_EMPLOYEE.EMP_GROUP_CODE} startswith "CU" and
(
({EC_EMPLOYEE.PREVIOUS_TERMINATION_DATE} > "19971231" and
{EC_EMPLOYEE.PREVIOUS_TERMINATION_CODE} = "RETIRED"
OR
({EC_EMPLOYEE.TERMINATION_DATE} > "19971231" AND
{EC_EMPLOYEE.TERMINATION_CODE} = "RETIRED"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
)
Now if I run this exact code in the Crystal SQL Designer. It works with no problems. I do not want to have to use the SQL Designer. Another problem I noticed is that When I go into SQL Query. It is missing brackets. If I go back into the Select Expert. I can see the brackets. So I tried going back into the SQL Query and manually put in the missing brackets. The report worked fine. But again also I do not want to have to do that. I feel I should be able run this simple or statement through the select expert. Here is what the table looks like. If I run this above formula through the select expert.
TD = Termination Date
TC = Termination Code
PTD = Previous Termination Date
PTC = Previous Termination Code
Name TD TC PTD PTC
-----------------------------------------
Test 19990610 Retired
Test2 20001120 Retired
It is only displaying what is before the OR. Here is what the table should look like. As in when i go into SQL Query and manually put in the missing brackets.
Name TD TC PTD PTC
-----------------------------------------
Test 19990610 Retired
Test2 20001120 Retired
Test3 19980212 Retired
Test4 20010519 Retired
It displays both sides of the OR. So what I have noticed is that the above formula looks right in the select expert. But when you view the acutal code in the Sql Query. Some of the brackets are missing.
Having an problem with and OR Statement. It will only display what is before the OR but will not show anything after the OR. Here is the formula:
{EC_EMPLOYEE.EMP_GROUP_CODE} startswith "CU" and
(
({EC_EMPLOYEE.PREVIOUS_TERMINATION_DATE} > "19971231" and
{EC_EMPLOYEE.PREVIOUS_TERMINATION_CODE} = "RETIRED"
OR
({EC_EMPLOYEE.TERMINATION_DATE} > "19971231" AND
{EC_EMPLOYEE.TERMINATION_CODE} = "RETIRED"
)
Now if I run this exact code in the Crystal SQL Designer. It works with no problems. I do not want to have to use the SQL Designer. Another problem I noticed is that When I go into SQL Query. It is missing brackets. If I go back into the Select Expert. I can see the brackets. So I tried going back into the SQL Query and manually put in the missing brackets. The report worked fine. But again also I do not want to have to do that. I feel I should be able run this simple or statement through the select expert. Here is what the table looks like. If I run this above formula through the select expert.
TD = Termination Date
TC = Termination Code
PTD = Previous Termination Date
PTC = Previous Termination Code
Name TD TC PTD PTC
-----------------------------------------
Test 19990610 Retired
Test2 20001120 Retired
It is only displaying what is before the OR. Here is what the table should look like. As in when i go into SQL Query and manually put in the missing brackets.
Name TD TC PTD PTC
-----------------------------------------
Test 19990610 Retired
Test2 20001120 Retired
Test3 19980212 Retired
Test4 20010519 Retired
It displays both sides of the OR. So what I have noticed is that the above formula looks right in the select expert. But when you view the acutal code in the Sql Query. Some of the brackets are missing.