Print Page | Close Window

Selecting NULL values in a case statement

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=461
Printed Date: 01 May 2024 at 10:59pm


Topic: Selecting NULL values in a case statement
Posted By: Tupacmoche
Subject: Selecting NULL values in a case statement
Date Posted: 04 Apr 2007 at 7:44am
Please note the following select statement
 
//Select Statement for labels used in the Consolidated Statement of earnings report.

Select {CODE_B.CODE_B} [1 to 12]
 Case "100", "150" :
  "10 Operations"
 Case "200" :
  "20 Direct Expenses"
 Case "210" :
  "21 Sales Promotion"
 Case "220" :
  "22 Sales Administration"
 Case "230" :
  "23 Marketing"
 Case "240" :
  "24 Business Development"
 Case "300" :
  "30 Administrative Expenses"
 Case "350" :
  "35 ERP Implementation Expenses"
 Case "400" :
  "40 Growth Expenses/Research & Development"
 Case "500" :
  "50 Quality"
 Case "600" :
  "60 Regulatory"
 Default :
  "Undefined Group";

There is one other case that I need to add. Unfortunitly this is a NULL value that I want to get to. There are about 33 records that are NULL in this table. So for MyFieldName that Is Null I want the case statement  to return "00 Null Value" where the field is NULL
 
Can someone tell me how to do this?  


-------------
Rob



Replies:
Posted By: BrianBischof
Date Posted: 04 Apr 2007 at 9:40am
Add in If Then statement at the end to catch it.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window