<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Null Parameter Values - Crystal 9 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107056#M2244399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create the formula (basic syntax):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if IsNull({?Parameter 1}) then
  formula = "&amp;lt;NULL&amp;gt;"
else
  if {?Parameter 1} = "" then
    formula = "&amp;lt;EMPTY&amp;gt;"
  else
    formula = {?Parameter 1}
  end if
end if
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and place it on the report header.  Run the report without entering {Parameter 1} and see what displays for the formula.  (I.e., is the parameter NULL or is it just empty?  If it's seen as empty, then your selection formula as written will not match any records.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Sep 2009 18:47:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-02T18:47:48Z</dc:date>
    <item>
      <title>Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaq-p/6107051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have several reports that require values be entered into a number of parameters by the end user running the report from the Crystal IDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If no value is entered in a parameter with a string data type, no records are returned. I check in the record selection formula for a null parameter value as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(If IsNull(?Parameter 1) Then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;True     //Show all records&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Else&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;(database field)=(?Parameter 1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(If IsNull(?Parameter 2) Then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;True     //Show all records for this condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Else&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;(database field)=(?Parameter 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;So on... until all my parameters&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears as though the record selection criteria sees a null in the or any parameter parmeter, and returns no records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like for the end user to be able to not enter any parameters, and have the record selection criteria return the records based on the defaults in the record selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have over 20 reports for 12 regions (20*12=240) 240 reports that have a minimum of 12 parameters each. The end users have to at least click on the parameter field when prompted so the record selection criteria will return the correct records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Another issue is I have a date parameter that the end user enters a to and from range. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I want to select the records that fall in the user entered date range and also include records that have a null as the value for this date field in our table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use as an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{Table.Date_Field_Name}={?Status_End_Date}  AND  IsNull({Table.Date_Field_Name})&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work as you would expect. If I remember correctly, It returned no records, but &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;IsNull({Table.Date_Field_Name})   AND  {Table.Date_Field_Name}={?Status_End_Date}&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seemed to work. Can you tell me why one way would work and the other will not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in Advance for your comments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2009 17:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaq-p/6107051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-01T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107052#M2244395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, Here is a correction:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use as an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{Table.Date_Field_Name}={?Status_End_Date} &lt;STRONG&gt;OR&lt;/STRONG&gt; IsNull({Table.Date_Field_Name})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work as you would expect. If I remember correctly, It returned no records, but&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IsNull({Table.Date_Field_Name}) &lt;STRONG&gt;OR&lt;/STRONG&gt; {Table.Date_Field_Name}={?Status_End_Date}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seemed to work. Can you tell me why one way would work and the other will not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2009 17:52:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107052#M2244395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-01T17:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107053#M2244396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the "OR" condition..if the 1st condition is true it will not check for the next condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case IsNull({Table.Date_Field_Name}) is true thats why it returned records when IsNull({Table.Date_Field_Name}) OR {Table.Date_Field_Name}={?Status_End_Date}.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Jyothi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2009 04:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107053#M2244396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-02T04:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107054#M2244397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... and as soon as Crystal "sees" a null field outside of an IsNull() function it stops processing the formula.  (IMHO, this makes no sense, but that's the way it works.)  So by using IsNull() first in the OR, it evaluates the OR as True, whereas putting it second causes Crystal to see the null parameter and halt evaluation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2009 17:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107054#M2244397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-02T17:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107055#M2244398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your comments. What you both say does make sense. I will always test for IsNull() first and I should be OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea about my empty or NULL parameter issue I mentioned at the top of this message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cort Collins&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2009 18:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107055#M2244398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-02T18:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Null Parameter Values - Crystal 9</title>
      <link>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107056#M2244399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create the formula (basic syntax):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if IsNull({?Parameter 1}) then
  formula = "&amp;lt;NULL&amp;gt;"
else
  if {?Parameter 1} = "" then
    formula = "&amp;lt;EMPTY&amp;gt;"
  else
    formula = {?Parameter 1}
  end if
end if
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and place it on the report header.  Run the report without entering {Parameter 1} and see what displays for the formula.  (I.e., is the parameter NULL or is it just empty?  If it's seen as empty, then your selection formula as written will not match any records.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2009 18:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/null-parameter-values-crystal-9/qaa-p/6107056#M2244399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-02T18:47:48Z</dc:date>
    </item>
  </channel>
</rss>

