troubleshooting Question

Show Query ignores part of Record Selection Formula

Avatar of CAHFS
CAHFS asked on
Crystal Reports
14 Comments1 Solution624 ViewsLast Modified:
When I display the query via Show query it does not list some criteria listed in the record seltion formula.
Specifically it is ignoring everything after the date criteria.

Here is the Record Selection Formula:
(
if {?Necropsy} = 'Necropsy Cases' then {C_FOLDERS_Necropsy_v.Necropsy} = "Y" else
if {?Necropsy} = 'Non Necropsy Cases' then {C_FOLDERS_Necropsy_v.Necropsy} = "N" else
if {?Necropsy} = 'Both Necropsy and Non Necropsy Cases' then {C_FOLDERS_Necropsy_v.Necropsy} = {C_FOLDERS_Necropsy_v.Necropsy}
) and
{FOLDERS.LOGDATE} IN
(IF {?Date Range}= "Last Full Month" THEN LastFullMonth
ELSE IF {?Date Range}="Last Full Week" THEN LastFullWeek
ELSE IF {?Date Range}="Year To Date" THEN Yeartodate
ELSE IF {?Date Range}="Last Two Weeks" then (currentdate - 15  to currentdate - 1)
ELSE {?Custom Date Range}
) and
(
        {FOLDER_DETAILS.DIAGNOSIS}= {?Key Words to search for:}
        or
        {?Key Words to search for:}="None"
) and
(  
    {?Client ID} = "All"
    or
    {FOLDERS.RASCLIENTID} = {?Client ID}
) and
(
    {C_legacy_species_lu.Legacy_species_name} = {?Species}
or
    {?Species}="All"
) and
(
    {?Laboratory} = "All"
    or  
    {FOLDERS.DEPT} = {?Laboratory}
) and
(
 {?Etiology} = "All"  
or
{STURCT_DIAGNOSIS_V.ETIOLOGY} like {?Etiology}
)

Here is the Show Query:


 SELECT "FOLDERS"."FOLDERNO", "FOLDER_DETAILS"."CLIENTREFNO", "FOLDERS"."DEPT", "USERS"."USRNAM", "FOLDER_DETAILS"."COLLCOUNTY", "C_FOLDERS_Necropsy_v"."Necropsy", "FOLDERS"."LOGDATE", "C_Folder_Roles_Submitter_v"."RASCLIENTID_RELATED", "FOLDER_SECTIONSUMMARIES"."TESTCATCODE", "FOLDERS"."RASCLIENTID", "C_legacy_species_lu"."Legacy_species_name", "STURCT_DIAGNOSIS_V"."ETIOLOGY", "C_RASCLIENTS_DETAILS_CUR_V"."COMPANYNAME", "C_RASCLIENTS_DETAILS_CUR_V"."FIRSTNAME", "C_RASCLIENTS_DETAILS_CUR_V"."LASTNAME", "SOURCE_ANIMAL_DETAILS"."AGE", "SOURCE_ANIMAL_DETAILS"."AGECATEGORY", "SOURCE_ANIMAL_DETAILS"."AGEUNITS", "FOLDER_DETAILS"."DIAGNOSIS", "FOLDER_SECTIONSUMMARIES"."SUMMARY", "FOLDER_DETAILS"."SUMMARY"
 FROM   {oj (((((((((("SL_LIS"."dbo"."FOLDERS" "FOLDERS" INNER JOIN "SL_LIS"."dbo"."FOLDER_DETAILS" "FOLDER_DETAILS" ON "FOLDERS"."FOLDERNO"="FOLDER_DETAILS"."FOLDERNO") INNER JOIN "SL_LIS"."dbo"."USERS" "USERS" ON "FOLDERS"."CASECOORD"="USERS"."USRNAM") INNER JOIN "SL_LIS"."dbo"."C_FOLDERS_Necropsy_v" "C_FOLDERS_Necropsy_v" ON "FOLDERS"."FOLDERNO"="C_FOLDERS_Necropsy_v"."folderno") INNER JOIN "SL_LIS"."dbo"."C_Folder_Roles_Submitter_v" "C_Folder_Roles_Submitter_v" ON "FOLDERS"."FOLDERNO"="C_Folder_Roles_Submitter_v"."FOLDERNO") LEFT OUTER JOIN "SL_LIS"."dbo"."FOLDER_SECTIONSUMMARIES" "FOLDER_SECTIONSUMMARIES" ON "FOLDERS"."FOLDERNO"="FOLDER_SECTIONSUMMARIES"."FOLDERNO") LEFT OUTER JOIN "SL_LIS"."dbo"."C_FOLDERS_LEGACY_SPECIES_V" "C_FOLDERS_LEGACY_SPECIES_V" ON "FOLDERS"."FOLDERNO"="C_FOLDERS_LEGACY_SPECIES_V"."FOLDERNO") LEFT OUTER JOIN "SL_LIS"."dbo"."STURCT_DIAGNOSIS_V" "STURCT_DIAGNOSIS_V" ON "FOLDERS"."FOLDERNO"="STURCT_DIAGNOSIS_V"."FOLDERNO") INNER JOIN "SL_LIS"."dbo"."SOURCES" "SOURCES" ON "FOLDERS"."FOLDERNO"="SOURCES"."FOLDERNO") INNER JOIN "SL_LIS"."dbo"."C_legacy_species_lu" "C_legacy_species_lu" ON "C_FOLDERS_LEGACY_SPECIES_V"."LEGACY_SPECIES_CODE"="C_legacy_species_lu"."VALUE") INNER JOIN "SL_LIS"."dbo"."C_RASCLIENTS_DETAILS_CUR_V" "C_RASCLIENTS_DETAILS_CUR_V" ON "C_Folder_Roles_Submitter_v"."RASCLIENTID_RELATED"="C_RASCLIENTS_DETAILS_CUR_V"."RASCLIENTID") INNER JOIN "SL_LIS"."dbo"."SOURCE_ANIMAL_DETAILS" "SOURCE_ANIMAL_DETAILS" ON "SOURCES"."ID"="SOURCE_ANIMAL_DETAILS"."SOURCEID"}
 WHERE  "C_FOLDERS_Necropsy_v"."Necropsy"="C_FOLDERS_Necropsy_v"."Necropsy" AND ("FOLDERS"."LOGDATE">={ts '2010-08-01 00:00:00'} AND "FOLDERS"."LOGDATE"<{ts '2010-09-01 00:00:00'})
 ORDER BY "FOLDERS"."DEPT", "FOLDERS"."FOLDERNO", "FOLDER_SECTIONSUMMARIES"."TESTCATCODE"
Any ideas?

CR Professional Version 11.0.0.2495

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros