on 06-28-2007 6:56 PM
Post Author: gazala
CA Forum: General
I have three parameters on report , one is boolean and two are dates.Condition is if user selects True from boolean parameter,it should display all data from table regardless of date ranges,whereas if user select False it should display data within date range.Problem is its not giving any result if user selects true.when i change the parameter type from boolean to String its giviing result.I have a limitation that i cannot change the parameter type from boolean to String.Below is the query for doing that:
select event_id,event_dt from event where event_dt like decode('{?alldates}','True','%') or event_dt between {?startdate} and {?endedate}
any suggestions ?
Post Author: gazala
CA Forum: General
I got my query worked by simply applying UPPER function around Parameter name and its value and the code looks like as below:
select event_id,event_dt from evt_event where event_dt like decode(upper('{?alldates}'),upper('True'),'%') or event_dt between {?sdate} and {?edate}.
I figured out that crystal take Boolean parameter as a String.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Post Author: SKodidine
CA Forum: General
I would suggest that you re-write your DECODE with IF THEN first. I do not use Oracle/PLSQL so I cannot test it. I think the decode is not working the way you want it to. This is the crystal syntax but you can easily convert it into your native SQL. Get it working for both true and false and then you can convert it to DECODE if necessary.
If {?alldates} = true then event_dt = event_dt
else event_dt in {?startdate} to {?endedate}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
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.