Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 06 Aug 2007 at 10:21am
Since you are using parameters, I assume you'll enter a zero for the parameter to be ignored? If so, I would do something like the following:
({empfield}=p_empid and {salaryfield}=p_salary) OR (p_empid=0 and {salaryfield}=p_salary) OR ({empfield}=p_empid and p_salary=0))
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>
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 07 Aug 2007 at 9:00am
It doesn't matter what you use. You have to identify how the user will specify that a parameter isn't going to be used. In a string I assume that is the empty string. For a date, I don't know. But then compare that field to the 'no-parameter' value. Here, I changed the second line to compare it to an empty string:
(p_empid='' and {salaryfield}=p_salary)....
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>
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum