on 03-06-2015 2:46 PM
Good Morning,
I am creating a crystal report using sql server. I created three note parameters with the idea that a user can search on the note parameter and the note1 parameter or the note parameter or note 2 parameter. The below formula will only allow me to use the note parameter or note 2 parameter, but not the first part note and note 1.
Thanks
(not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*") and
(not HasValue({?Notes1}) OR {IB_NOTES.NOTES} like "*"+{?Notes1}+"*")
or
(not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*") or
(not HasValue({?Note 2}) OR {IB_NOTES.NOTES} like "*"+{?Note 2}+"*")
Thanks Abhilash. Although the or part works with this logic and the part does not. Can you tweak this formula to have the whole logic work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Natalia,
If
(not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*")
is true then the Or takes precedence over the And. So Notes2 will always be evaluated.
Try a nested if like:
If (not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*") And
(
(not HasValue({?Notes1}) OR {IB_NOTES.NOTES} like "*"+{?Notes1}+"*") Or
(not HasValue({?Note 2}) OR {IB_NOTES.NOTES} like "*"+{?Note 2}+"*")
)
This way the Notes are evaluated once then it checks the Notes1 or Notes2.
Hope this helps,
Brian
Hi Natalia,
Try:
(
(not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*") and
(not HasValue({?Notes1}) OR {IB_NOTES.NOTES} like "*"+{?Notes1}+"*")
)
OR
(
(not HasValue({?Notes}) OR {IB_NOTES.NOTES} like "*"+{?Notes}+"*") or
(not HasValue({?Note 2}) OR {IB_NOTES.NOTES} like "*"+{?Note 2}+"*")
)
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.