Click to See Complete Forum and Search --> : report by multiple parameter with OR relationship
heliang
May 29th, 2007, 10:10 AM
I am trying to create a report with three parameters (date, license number and application number). I want report by License Number or Application number in the date that I put in. I trying following in Record Selection:
1.
{Command.LICENSE_NO} = {?License Number} or
{Command.LICENSE_ID} = {?Application Number}
2.
if isnull({?License Number}) = false then
{Command.LICENSE_NO} = {?License Number};
if isnull({?Application Number})=false then
{Command.LICENSE_ID}={?Application Number};
** license_id is the application number(number). license number(string)
but both of them do not work. somehow I can not leave Application number empty.
Please Help!!!
JaganEllis
May 29th, 2007, 09:47 PM
As Application Number is a number, Crystal wants you to specify one.
If you default it to 0 you could have a selection formula like
({?Application Number} = 0 and {Command.LICENSE_NO} = {?License Number})
or
({?Application Number} <> 0 and {Command.LICENSE_ID} = {?Application Number})
which means that if you supply a non-zero application number it will be used in preference to any licence id you provide.
heliang
May 30th, 2007, 09:11 AM
As Application Number is a number, Crystal wants you to specify one.
If you default it to 0 you could have a selection formula like
({?Application Number} = 0 and {Command.LICENSE_NO} = {?License Number})
or
({?Application Number} <> 0 and {Command.LICENSE_ID} = {?Application Number})
which means that if you supply a non-zero application number it will be used in preference to any licence id you provide.
I have tried using 0 as default, but for some reason. I still can not leave application number empty. I used exactly same as your code
({?Application Number} = 0 and {Command.LICENSE_NO} = {?License Number})
or
({?Application Number} <> 0 and {Command.LICENSE_ID} = {?Application Number})
but search will not start if I leave application parameter empty.
any thought?
Thanks for your help
heliang
May 30th, 2007, 11:17 AM
As Application Number is a number, Crystal wants you to specify one.
If you default it to 0 you could have a selection formula like
({?Application Number} = 0 and {Command.LICENSE_NO} = {?License Number})
or
({?Application Number} <> 0 and {Command.LICENSE_ID} = {?Application Number})
which means that if you supply a non-zero application number it will be used in preference to any licence id you provide.
Got it working with your code!!!
Thanks your so much!!
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.