Reputation: 45
I am using SQL Joins to retrieve data from multiple tables. I am grouping records by department. I want to show only those records where Department Name not null. I can control this through JOINS but in some other scenarios I need to show null department records. Is there any formula to make it possible? My current formula is:
if {?ParamGrp} = "Department" then
(
"Department Name: " &{tblEmployees.DepartmentName}
)
else if {?ParamGrp} = "" then
(
""
)
Upvotes: 1
Views: 1631
Reputation: 3680
Crystal has a built in formula ISNULL()
for situations where a value is literally null, and not just an empty string. You can splice it into your existing code easily:
IF ISNULL({tblEmployees.DepartmentName}) OR {?ParamGrp} = "" THEN
""
ELSE IF {?ParamGrp} = "Department" THEN
"Department Name: " & {tblEmployees.DepartmentName}
Upvotes: 1